Search Issue Tracker
By Design
Votes
5
Found in [Package]
1.0.0-preview.18
Issue ID
1372774
Regression
No
UIToolkit Input Text Field is auto-selected when keys are pressed
Reproduction steps:
1. Open the user's attached project
2. Open Assets > Scenes > SampleScene
3. Go to Game View and press play
4. Press Z/Q/S/D keys and observe the behavior
Expected results: UIToolkit Input Text Field needs to be selected by clicking on the text field
Actual results: UIToolkit Input Text Field is auto-selected when keys are pressed
Reproduced in: 1.0.0-preview.18 (2020.3.20f1, 2021.1.25f1, 2021.2.0b16, 2022.1.0a12)
Could not test with: 2019.4.31f1 (UI Toolkit is not introduced yet)
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
- Audio Mixer does not change volume when lowering volume on an Audio Mixer loaded from AssetBundles
- Error “Value cannot be null. Parameter name: key UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)” thrown and Addressables build fails when "Include in Build" is disabled and using Addressables For Android package
- “error CS0433: The type 'CodeBinaryOperatorType' exists in both 'System.CodeDom and 'System" compilation errors are thrown when opening a specific project
- Metal Vertex Shader warning is being thrown when creating a VR Template Project
- Asset database warning is thrown when declaring font variable in the USS text file
Resolution Note:
The ability to start using the UI using the keyboard only, without having a prior selected element, is a feature that some users are depending on, not a bug. Unless the design changes at some point in the future, it is unlikely for this to be "fixed".
That being said, there are a few ways to work around the situation mentioned in this bug. Any of the following should work:
1. set the TextField's tabIndex to -1
2. Remove the WASD (or ZQSD mentioned in the description) mapping for the Horizontal and Vertical axes in the InputManager
3. add EventSystem + StandaloneInputModule to scene, then untick the "Send Navigation Events" box.
4. panel.visualTree.RegisterCallback<NavigationMoveEvent>(e => e.PreventDefault(), TrickleDown.TrickleDown)