Search Issue Tracker
By Design
Votes
0
Found in [Package]
1.1.0-preview.14
Issue ID
1345865
Regression
No
Disabling the 'Deselect On Background Clicks' option in Input Module component doesn't work when using UIToolkit
How to reproduce:
1. Open the attached project's Scene labeled "Main Menu"
2. Enter the Play Mode
3. In the Game View, move the Gamepad's Left Joystick (to select visual elements)
4. Using the mouse, click on the background
5. Inspect the Console Window
Expected result: Currently selected visual element is not null
Actual result: Currently selected visual element is null
Reproducible with: 2021.2.0b4, 2022.1.0a2
Couldn't test with: 2019.4.29f1 (UI Toolkit is not available), 2020.3.14f1, 2021.1.16f1 (Project breaks when downgrading)
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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note:
The UIDocument in the repro project has a white background ("#wrap") that covers the entire GameView window and that has PickingMode=Position. This means that clicking on it will deselect any other selected element, as per the design of UI Toolkit, and as would happen in a regular, non-runtime EditorWindow. I've just verified that setting PickingMode=Ignore on the background element does indeed stop the deselection from happening.
I have also tested the DeselectOnBackgroundClick option in an empty scene with just 1 UIDocument with 1 TextField, and a GameObject with the EventSystem + InputSystemUIInputModule components. Clicking in the background does deselect the TextField, if and only if the DeselectOnBackgroundClick option is enabled.
This feature seems to be working as intended.