Selectable no longer selects itself on click if there are keyboard events.

#60 Open
Repository
TJHeuvel
Branch
5.2
Repository
Unity-Technologies
Branch
5.2

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update 
hg pull -r 5.2 https://bitbucket.org/TJHeuvel/ui
Author
  1. TJHeuvel
Reviewers
Description

By default Buttons stay selected after you click them. This confused me, and many other users. It is behaviour that regular buttons in your OS definitely dont share. For regular mouse navigation this is extremely unexpected behaviour, though it could be useful for console games, or keyboard navigation.

My change will only keep it selected when keyboard navigation is enabled. This makes sense, because its what you expect on keyboard navigation, and not when there is no keyboard navigation.

It is possible to get this behaviour currently by setting Navigation to None on all selectables. This is quite counterintuitive, i have no clue what these names mean. I guess its KeyboardNavigation? Why is this an option per UI element, and not something globally?

If you ask me, Selected and Highlighted should definitely have a different visual state too, and this change should be default.

https://forum.unity.com/threads/clicking-a-button-leaves-it-in-mouseover-state.285167/#post-2977741 https://www.reddit.com/r/Unity3D/comments/2u89py/any_way_to_avoid_selecting_a_ui_button_when/?st=j7q1h3h7&sh=32e41d8d https://gamedev.stackexchange.com/questions/92146/button-stays-highlighted-after-being-clicked-unity3d-4-6-gui https://forum.unity.com/threads/toggle-button-keep-pressed-state.481359/ https://stackoverflow.com/questions/40768106/unity-ui-button-has-insane-transition-state-behaviour-it-remains-highlighted-a https://forum.unity.com/threads/left-mouse-click-breaks-ui-buttons-why-solved.417769/

Etc

Comments (0)