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

LongPress gesture cancellation #316

Closed
rt2zz opened this issue Oct 18, 2018 · 4 comments
Closed

LongPress gesture cancellation #316

rt2zz opened this issue Oct 18, 2018 · 4 comments

Comments

@rt2zz
Copy link

rt2zz commented Oct 18, 2018

On Android, when a long press is activated, and the user then pans away (without lifting the gesture) the LongPressGestureHandler enters a cancelled state.

in iOS the gesture does not cancel and continues to fire gesture events until the gesture is released by lifting the finger.

This comment seems to suggest that the iOS behavior is intended and that android has a bug: #94 (comment)

The bug prevents (afaict) the feature I am working on from being possible in RNGH: activate a chart scrubber upon long press.

@jeanregisser
Copy link

I'm affected by this bug as well.

Did you find any workaround @rt2zz?

@rt2zz
Copy link
Author

rt2zz commented Nov 21, 2018

I have not, I suspect this could be achieved with PanGestureHandler with simultaneous handlers setup, but there were some implementation challenges I ran into and am not sure what a solution would look like.

@lvmtam
Copy link

lvmtam commented Jan 25, 2019

I also have the same issue. Seem to be strange.

@rt2zz
Copy link
Author

rt2zz commented Jan 26, 2019

found the issue, on android maxDist defaults to a small value thus cancelling the gesture after a short pan. Set that to screen width, or whatever makes sense for your component to fix this issue.

Not sure why the iOS behavior does not match?

@rt2zz rt2zz closed this as completed Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants