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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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.