Search Issue Tracker
By Design
By Design in 2022.2.X
Votes
0
Found in
2020.3.32f1
2021.2.19f1
2021.3.0f1
2022.1.0b15
2022.2.0a10
Issue ID
UUM-3464
Regression
No
PointerUpEvent doesn't work when using left-click on a dragger of the Slider
Reproduction steps:
1. Open users attached project
2. Open Assets > Scenes > SampleScene.unity
3. Enter Play Mode
4. In the Game View left-click and release the dragger of the Slider
5. Observe the Console window
Expected result: "down" and "up" messages are printed in the Console
Actual result: Only the "down" message is printed is in the Console
Reproducible with: 1.0.0-preview.15, 1.0.0-preview.18 (2020.3.32f1), Built-in (2021.2.19f1, 2021.3.0f1, 2022.1.0b15, 2022.2.0a10)
Couldn't test with: 2019.4.38f1 (UI Toolkit not supported)
Note: PointerUpEvent works when using right-click
See: https://unity.slack.com/archives/C3414V4UV/p1656015671717799
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:
This is not necessarily a bug as much as it's a possibly controversial design decision, to make pointer event callbacks only triggered on the capturing element itself and not its parents (even composite root parents) when there's a pointer capture. Exclusive processing by capturing element has been part of UI Toolkit for more than 5 years.
Moreover, there's a relatively easy workaround. You can use
```
slider.Q<VisualElement>("unity-drag-container").RegisterCallback<PointerUpEvent>(e => Debug.Log("Slider dragger PointerUp"));
```
to react to the PointerUpEvent in this situation. You can discover what exact element was receiving the PointerUpEvent by using the UI Toolkit Event Debugger window, in Project Settings -> UI Toolkit -> Enable Event Debugger, then Window -> UI Toolkit -> Event Debugger.
Note that we are changing how pointer events are propagated as part of an event dispatch simplification effort in 2023.2, which include getting rid of the exclusive processing by capturing element, but we don't want to change it in earlier versions such as 2021.3 or 2022.2, or even 2023.1.
Resolution Note (2022.2.X):
This is not necessarily a bug as much as it's a possibly controversial design decision, to make pointer event callbacks only triggered on the capturing element itself and not its parents (even composite root parents) when there's a pointer capture. Exclusive processing by capturing element has been part of UI Toolkit for more than 5 years.
Moreover, there's a relatively easy workaround. You can use
```
slider.Q<VisualElement>("unity-drag-container").RegisterCallback<PointerUpEvent>(e => Debug.Log("Slider dragger PointerUp"));
```
to react to the PointerUpEvent in this situation. You can discover what exact element was receiving the PointerUpEvent by using the UI Toolkit Event Debugger window, in Project Settings -> UI Toolkit -> Enable Event Debugger, then Window -> UI Toolkit -> Event Debugger.
Note that we are changing how pointer events are propagated as part of an event dispatch simplification effort in 2023.2, which include getting rid of the exclusive processing by capturing element, but we don't want to change it in earlier versions such as 2021.3 or 2022.2, or even 2023.1.