Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual glitch while switching radio buttons #4785

Open
jakubziebin opened this issue Jul 22, 2024 · 3 comments
Open

Visual glitch while switching radio buttons #4785

jakubziebin opened this issue Jul 22, 2024 · 3 comments

Comments

@jakubziebin
Copy link

jakubziebin commented Jul 22, 2024

Hello,
We have a problem with the RadioButtons buttons located in the RadioSet. When switching the buttons, sometimes the situation with the video appears.
issue_textual.webm
Unfortunately, it is not possible to reproduce the problem with MRE (or it is so difficult). We do a workaround for this problem by adding a refresh call in the watch__selected method.
Workaround code:

class MyRadioSet(RadioSet):
    def watch__selected(self) -> None:
        super().watch__selected()
        self.refresh(layout=True)

Textual diagnose:

# Textual Diagnostics

## Versions

| Name    | Value  |
|---------|--------|
| Textual | 0.73.0 |
| Rich    | 13.7.0 |

## Python

| Name           | Value                                                  |
|----------------|--------------------------------------------------------|
| Version        | 3.10.6                                                 |
| Implementation | CPython                                                |
| Compiler       | GCC 11.4.0                                             |
| Executable     | /home/dev/.pyenv/versions/3.10.6/envs/clive/bin/python |

## Operating System

| Name    | Value                                                            |
|---------|------------------------------------------------------------------|
| System  | Linux                                                            |
| Release | 6.5.0-44-generic                                                 |
| Version | #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 14:36:16 UTC 2 |

## Terminal

| Name                 | Value          |
|----------------------|----------------|
| Terminal Application | GNOME Terminal |
| TERM                 | xterm-256color |
| COLORTERM            | truecolor      |
| FORCE_COLOR          | *Not set*      |
| NO_COLOR             | *Not set*      |

## Rich Console options

| Name           | Value                |
|----------------|----------------------|
| size           | width=133, height=43 |
| legacy_windows | False                |
| min_width      | 1                    |
| max_width      | 133                  |
| is_terminal    | True                 |
| encoding       | utf-8                |
| max_height     | 43                   |
| justify        | None                 |
| overflow       | None                 |
| no_wrap        | False                |
| highlight      | None                 |
| markup         | None                 |
| height         | None                 |
@jakubziebin jakubziebin changed the title Error while switching radio buttons Visual glitch while switching radio buttons Jul 22, 2024
@Textualize Textualize deleted a comment from github-actions bot Jul 30, 2024
@Textualize Textualize deleted a comment from merriam Jul 30, 2024
@willmcgugan
Copy link
Collaborator

@jakubziebin Without an MRE it is going to be difficult to diagnose.

I see you are doing some kind of customization, can you at least let us know what you changed over the defaults?

@jakubziebin
Copy link
Author

jakubziebin commented Sep 13, 2024

Sorry for the late reply. I customizied radio-button:

class CustomRadioButton(RadioButton):
    """Due to bug in Ubuntu we have to replace icon of the RadioButton by simple 'O'."""

    BUTTON_INNER = "O"

and the radio set adjusted as I sent it. Unfortunately, I can't reproduce this with the MRE.

@willmcgugan
Copy link
Collaborator

I can't reproduce this. Can you share the code you are using to create and modify the radio set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants