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

Combobox selection error #136

Open
Nitaki-dev opened this issue Apr 27, 2024 · 7 comments
Open

Combobox selection error #136

Nitaki-dev opened this issue Apr 27, 2024 · 7 comments

Comments

@Nitaki-dev
Copy link

After selecting any item from a combobox, the text highlight stays, even when the combobox no longer has focus. (in both light and dark theme)

With theme:
image

Without theme (how it should be):
image

@rdbende
Copy link
Owner

rdbende commented Apr 27, 2024

Hi, can you share the steps to reproduce this? Last time I checked the behavior was the same with the default theme, and the selection went away when another widget was focused.

@Nitaki-dev
Copy link
Author

You can recreate this by running the Widget demo, and changing the value of the readonly combobox to anything, and then click on anythingelse to change the focus

@rdbende
Copy link
Owner

rdbende commented Apr 27, 2024

Hmm, I see no difference, except that with clam the selection is grey when unfocused.

sv-ttk: Képernyőfelvétel 2024-04-27 18-11-26.webm

clam: Képernyőfelvétel 2024-04-27 18-14-03.webm

ps: forgot to record the mouse :D

@rdbende
Copy link
Owner

rdbende commented Apr 27, 2024

default theme: Képernyőfelvétel 2024-04-27 18-34-41.webm

@rdbende
Copy link
Owner

rdbende commented Apr 27, 2024

And yes, there's a difference between the three, though I'm not sure which behavior sv-ttk should follow.

@Nitaki-dev
Copy link
Author

huh, weird. for me without any themes it does this:

0427.mp4

As you can see, whenever the focus is taken away from the combobox, the blue background disappears.
Im not sure if that is how you want sv-ttk to function, but i think thats how it should be. Are there any ways for me to still achieve this?

@LaG1924
Copy link

LaG1924 commented Aug 15, 2024

I also encountered this problem. In the default theme, the highlight is removed when the widget loses focus, but in sv-ttk the highlight remains.

The solution for me is as follows (https://stackoverflow.com/a/71531095):

def on_select(event):
    selected = var.get()
    combobox.set("")
    combobox.set(select)
combobox.bind("<<ComboboxSelected>>", on_select)

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

3 participants