Search Issue Tracker
By Design
Votes
0
Found in [Package]
Built-in
Issue ID
1404522
Regression
No
UI Document Button is not focused when using "rootVisualElement.SetEnabled(true)"
How to reproduce:
1. Open project "Bug Report Beta.zip"
2. Enter Play Mode
3. Focus on any button and press "Enter" then move with WASD or arrows keys
4. Observe the result
5. Focus any button and In the Hierarchy window select "GameObject" and turn in the Inspector window turn off "Disable" in the "New Behaviour Script" Component
6. Repeat 3rd step and observe the result
Expected result: The Button is focused
Actual result: The Button is not focused
Reproducible with: Built-in (2021.2.15f1, 2022.1.0b11, 2022.2.0a7)
Could not test with: 2019.4.36f1, 2020.3.30f1 (Errors after downgrade)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- GetCurrentAnimatorClipInfoCount() and GetNextAnimatorClipInfoCount() return 0 when animator is in transition
- GPU utilization increases by 20% on Meta Quest headsets when Render Graph is enabled on 6000.0.16f1 and higher
- Value on Slider (Int) control in UI Builder displays as default when saving UI Document
- Color mismatch in UI Builders Library panel when the Editors theme is set to Light Mode
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
Resolution Note:
By design, "disabled focused" elements aren't supposed to exist, they have no default styling and they have no clear behaviour regarding whether or not they should be receiving keyboard events or other such focus-based events.
When an element gets disabled, it automatically loses focus, re-enabling it will not give the focus back, this needs to be explicitly done by user code