-
-
Notifications
You must be signed in to change notification settings - Fork 984
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
Gesture.Manual().shouldCancelWhenOutside(true) doesn't work on iOS or web #2265
Comments
Hi @elliotwaite 👋 Please have a look at this PR, which should solve problems on web version. |
@Warus15, okay, nice, thanks for the update. |
## Description This PR solves web part of #2265 issue. I've modified `onPointerOut` method to act similar as on android. Right now, if pointer leaves handler and `shouldCancelWhenOutside` is set to `true`, handler goes to `cancel` state if it was `active`, or to `fail`, if it was in `began` This change also affects `ManualGestureHandler`, which now cancels properly. ## Test plan Tested on example app
Hi @elliotwaite! I've also managed to solve this problem on iOS, could you have a look at this PR and check whether it indeed solves your issue? |
Hey @Warus15, yeah, I just tested out that new PR and it fixed the issue for me on iOS. And that previous PR fixed the web version. Thanks! Should I close this issue now or wait till that PR is merged? |
Hello @elliotwaite! You can close this issue, this PR should be merged pretty quickly so there's no need to wait for that. |
## Description This PR adds changes in `ManualGestureHandler` on iOS. It should now properly react to `shouldCancelWhenOutside` prop. This PR should solve part of #2265 issue. ## Test plan Tested on example app
I'm closing this issue since the PR has been merged. Feel free to re-open it if something isn't right. |
@Warus15, sounds good. |
Description
Using
Gesture.Manual().shouldCancelWhenOutside(true)
doesn't seem to work on iOS or web. As can be seen in this demo:UPDATE: I did some more testing to compare how Tap, LongPress, and Manual work when using
shouldCancelWhenOutside(true)
.On Android it works correctly for all three gestures (Tap, LongPress, and Manual):
On iOS it works correctly for Tap and LongPress but not Manual:
On the web:
Steps to reproduce
You can test out the Android and iOS versions using this Snack demo, but I haven't figured out how to get the web version to work on Snack yet. If I try to use
enableExperimentalWebImplementation(true)
, it says it's not a function. Any suggestions? However, I tested the web version on my local machine as can be seen in the animated GIFs.Snack or a link to a repository
https://snack.expo.dev/@elliotwaite/rngh-shouldcancelwhenoutside
Gesture Handler version
2.7.0
React Native version
0.69.0
Platforms
Android, iOS, Web
JavaScript runtime
No response
Workflow
No response
Architecture
No response
Build type
No response
Device
No response
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: