-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
widget: make Button trigger unfocus when tapped. #5152
base: develop
Are you sure you want to change the base?
Conversation
That's not how other widgets behave. If someone wants to switch to keyboard handling then it should start from the last item they interacted with. This may relate to a request for "remember potential focus in case keyboard controls are used" which would be a behaviour change and would have to apply to most widgets (not Entry ;) ) in a major release like 2.6. |
So you are saying that clicking the button should not unfocus anything? |
That's not what I am saying. |
I see. The reason I removed focus was that otherwise the button appears in focus mode (blue background with the default theme) once clicked. Is this expected? |
That is how other widgets behave isn't it? |
I think this might be a sensible change. It seems like many applications on my computer at least do unfocus when you press a button. |
Rather than considering just the visual state we need to consider the context. When another toolkit "unfocuses" the button after tapping with a mouse what happens if you hit space or enter? What happens if you hit tab? In my experience the item still has focus it just doesn't indicate that for this situation. |
So would only removing the visuals of the focus for a clicked button but keeping its focus be fine? |
Fixes #5107.
Description:
Previously, widget.Button did not grab the focus when tapped, resulting in any focused widget on the canvas remaining focused. Now it does gab the focus and then releases it as this should be transient for a button.
Fixes #5107.
Checklist:
(besides language related ones)