Copyright © 2026 Unity Technologies
This is the intended behavior, as designed. The UI Toolkit Runtime behavior now exactly matches the UI Toolkit Editor behavior: mouse events are sent exclusively to the capturing element. In this case, the capture happened during the PointerDownEvent that came right before it, so the MouseDownEvent is sent excusively to the TextElement child of the TextField, which captures the mouse at that time. There are a few ways to get the GetsTriggered method called in the repro example: 1. use PointerDownEvent instead of MouseDownEvent {code:c#}private void GetsTriggered(PointerDownEvent ev) { Debug.Log("Triggered"); } testMouseDownEvent.RegisterCallback<PointerDownEvent>(GetsTriggered);{code} 2. register your callback on the TextElement that has the capture {code:c#}testMouseDownEvent.Q<VisualElement>("unity-text-input").Q<TextElement>().RegisterCallback<MouseDownEvent>(GetsTriggered);{code} 3. starting from 2023.2, it will also work if you register the MouseDownEvent on the TrickleDown phase {code:c#}testMouseDownEvent.RegisterCallback<MouseDownEvent>(GetsTriggered, TrickleDown.TrickleDown);{code}
How to reproduce:
1. Open the “UIToolkitTextField“ project
2. Enter the Play Mode
3. In the Game view click on the “Text Field“ text
4. In the Game view click on the middle of the white rectangle
5. Observe the Console window
Expected result: Two “Triggered“ messages logged to the Console window
Actual result: One “Triggered“ message logged to the Console window
Reproducible with: 2022.3.20f1, 2022.3.25f1, 2023.2.19f1, 6000.0.0b15
Not reproducible with: 2021.3.37f1, 2022.3.19f1
Reproducible on: macOS 13.5.2 (Intel), Windows 10 Pro
Not reproducible on: No other environments tested
Workaround:
1. Open the “Window > UI Toolkit > Debugger“
2. Pick the TextElement in the white rectangle
3. Switch the Picing Mode to Ignore
Notes:
Issues you vote on will appear here