Closed Youssef1313 closed 1 week ago
This depends of the ManipulationMode
used in your visual tree. The behavior you described is when you let the default System
mode (which allows direct manipualtions ). Basically it's a hack to inform the application that, for performance consideration, it won't get the pointer events anymore. If plan didn't changed, this mode is to be deprecated by the new ScrollView
.
As we don't have such "direct manipulation" in uno, it's doesn't really make sens to implement it this way as anyway it's only confusing for user.
Let me clarify : yes we need to fix the fact the sub elements should not get the events. (Explicit capture the pointer on the ScrollContentPresenter
is probably enough, and it has to get priority over any existing capture - like a Button.Click
).
But I don't think that we should have a dedicated dispatch path of pointer events like they have on windows.
Basically it means that parent element will still be able to see pointer events, while on windows they are not able to.
Current behavior
When having a
ScrollViewer
on Skia on a touch device, if you press with finger, move the finger, and release it (i.e, scroll with the finger), the event sequence will be pointer pressed, few pointer moved, then pointer released.This behavior is not correct and doesn't match WinUI.
Expected behavior
On WinUI, once you start moving (regardless of whether that move causes a scroll or not), you get a PointerCaptureLost, and then you don't get any more events.
How to reproduce it (as minimally and precisely as possible)
Workaround
No response
Works on UWP/WinUI
Yes
Environment
No response
NuGet package version(s)
No response
Affected platforms
No response
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
NOTES:
The current behavior can cause scrolling to click on an element when it shouldn't.
The way this works in WinUI is that ScrollViewer uses Direct Manipulation (see https://learn.microsoft.com/windows/win32/directmanipulation/direct-manipulation-portal):
Then, WinUI's
PointerInputProcessor
will receive the POINTERCAPTURECHANGED window message, and will raise PointerCaptureLost event.No more events are received. So we don't receive a
PointerReleased
(which is a source of evil in this case)