Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PanGesture notify Completed event moving outside View limits #15700

Merged
merged 30 commits into from
Feb 2, 2024
Merged

Conversation

jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Jun 16, 2023

Description of Change

The PanGesture reports a completed event status when the touch is lifted.

To test the changes, use the added sample in the .NET MAUI Gallery. You can find it in Core > Gestures > PanGesture Gallery.

image

Issues Fixed

Fixes #5191

@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/windows 🪟 area-gestures Gesture types labels Jun 16, 2023
@jsuarezruiz
Copy link
Contributor Author

This PR include changes associated with the PanGestureRecognizer firing the Complete status if we move outside the View with the gesture limits. Feedback?

@jsuarezruiz jsuarezruiz marked this pull request as ready for review June 19, 2023 10:54
@jsuarezruiz jsuarezruiz requested a review from PureWeen June 21, 2023 15:06
@mattleibow
Copy link
Member

Is this expected? I think panning should work when the pointer goes out of the view, and only complete where the cursor is lifted. What happens if you hold the button down and drag out and while still holding, return to the view. I feel it should continue the pan?

@hartez
Copy link
Contributor

hartez commented Jul 7, 2023

This is not how it worked in Forms. And as far as I can tell, this is not how it works on any native applications. The pan gesture is "completed" when the touch is lifted, not when the touch goes outside the bounds of the view.

@hartez hartez marked this pull request as draft July 7, 2023 21:54
@jsuarezruiz
Copy link
Contributor Author

This is not how it worked in Forms. And as far as I can tell, this is not how it works on any native applications. The pan gesture is "completed" when the touch is lifted, not when the touch goes outside the bounds of the view.

Thanks for the feedback. I've aligned behaviors across all platforms. In all cases pan gesture is "completed" when the touch is lifted (inside or outside the View where the gesture began).

Android
fix-pan-droid
iOS
fix-pan-ios
Windows
fix-pan-win

@samhouts samhouts added this to the .NET 8 SR2 milestone Oct 12, 2023
@jsuarezruiz jsuarezruiz removed the s/pr-needs-author-input PR needs an update from the author label Oct 18, 2023
@samhouts samhouts added the stale Indicates a stale issue/pr and will be closed soon label Dec 7, 2023
@jsuarezruiz jsuarezruiz removed the stale Indicates a stale issue/pr and will be closed soon label Dec 12, 2023
@samhouts samhouts added the stale Indicates a stale issue/pr and will be closed soon label Jan 8, 2024
@hartez hartez removed their request for review January 10, 2024 21:02
@rmarinho
Copy link
Member

Seems we removed the test ?

@jsuarezruiz
Copy link
Contributor Author

Seems we removed the test ?

Added UITest.

image

@PureWeen PureWeen removed this from the .NET 8 SR2 milestone Jan 16, 2024
@jsuarezruiz jsuarezruiz requested review from tj-devel709 and Foda and removed request for StephaneDelcroix and Foda January 18, 2024 09:15
Copy link
Member

@tj-devel709 tj-devel709 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Windows and Android. Was able to see the Completed event trigger when I let go inside and outside the original view. I am curious how to trigger the Canceled event though

@rmarinho rmarinho merged commit aafaff3 into main Feb 2, 2024
47 checks passed
@rmarinho rmarinho deleted the fix-5191 branch February 2, 2024 12:35
PureWeen pushed a commit that referenced this pull request Feb 8, 2024
* Fix the issue

* Added sample

* Fix the issue on Android

* Updated Impl

* Implement the changes also on iOS/Catalyst

* Revert changes on Android and iOS

* More changes

* Remove unnecessary changes

* Align Windows behavior with the test of the platforms

* Removed unnecessary changes

* Added UITest

* Removed test

* Added UITest
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pangesture does not trigger exit/completed/cancel event while pan moves outside of the layout/control
8 participants