[C# Markup?] OnPointerReleased not triggered on ScrollViewer #2563
Labels
kind/bug
Something isn't working
triage/untriaged
Indicates an issue requires triaging or verification.
Current behavior
Issue 1;
OnPointerReleased
is not triggered in Template ControlIssue 2
Inconsistent OriginalSource type of
OnPointerReleased
Issue 1;
This Issue is tricky.
Create following Control as shown below.
override
OnPointerReleased
. This method should be called when control is Left-Mouse-Clicked.Unfortunately in some scenarios the method is not called.
The control shows a collection of items on Canvas in some container.
You can use one of containers:
ScrollViewer
andFrame
to embedItemsRepeater
:ScrollViewer
is used, theOnPointerReleased
is not triggered.Frame
is used, theOnPointerReleased
is triggered as expected.You can use one Item templates: simple
Rectangle
or aNodeCtrl
,NodeCtrl
is another Control that shows simpleRectangle
.Rectangle
is used, theOnPointerReleased
is triggered as expected.NodeCtrl
is used, theOnPointerReleased
is not triggered.So, I observe following behavior of
OnPointerReleased
:As you see, I cannot tell if the issue is related to
ScrollViewer
, or toNodeCtrl
.The implementation of
NodeCtrl
is straight forward:I suppose, the issue is related to
ScrollViewer
.Issue 2
Inconsistent value of
OriginalSource
ofPointerRoutedEventArgs
delivered byOnPointerReleased
:While Left-mouse-button does not trigger the method, Right-mouse-button and Middle-mouse-button are not affected and work fine in all scenarios.
if you check a value of
OriginalSource
ofPointerRoutedEventArgs
, you will notice that unfortunately it is initialized differently inDesktop
andWindowsSDK
:Desktop
: an object of typeScrollContentPresenter
is deliveredWindowsSDK
: an object of typeGrid
is deliveredI suppose, this issue is related to C# Markup (not sure...)
Expected behavior
Issue 1
OnPointerReleased
shall be triggered in all scenarios.Issue 2
OriginalSource
shall be consistent cross platform. An object of typeScrollContentPresenter
seems to be the right one.How to reproduce it (as minimally and precisely as possible)
MINIMAL REPRO PROJECT:
Uno.OnPointerReleasedApp.zip
STEPS TO REPRODUCE
Desktop
orWindowsSdk
(both are affected).OnPointerReleased
in not triggeredFrame
or Item toRectangle
and rebuildOnPointerReleased
in triggered as expectedEnvironment
Nuget Package (s):
"Uno.Sdk": "5.3.108"
Package Version(s):
Affected platform(s):
Visual Studio:
Relevant plugins:
Anything else we need to know?
Issue 2 seems to have the same nature as #2416
The text was updated successfully, but these errors were encountered: