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

PinchHandler not working on Android in conjunction with scrollview/flatlist #1082

Closed
stevenmathers opened this issue Jun 5, 2020 · 3 comments
Labels
Area: Gesture handlers This issue is related to problems with gesture handlers Platform: Android This issue is specific to Android

Comments

@stevenmathers
Copy link

I am using RNGH 1.6.1 and RN 0.62.2

I am trying to use the PinchGestureHandler for my react native project. I need a pinch for a scrollview/flatlist.
I have done the simplest test implementation, wrapping the flatlist, and connecting the event listeners to a console.log so I can observe the state changes in the handler as I make the gesture

On IOS this works fine.

On Android, I can see the gesture enter the BEGAN state but 95% of the time it then CANCELS. Only very rarely, with infinite care with my gesture, can I get the pinch state to become ACTIVE.

From my observations, if the scrollview moves at all, it causes the cancel. So it seems to me that the scrollview is receiving the gesture events simultaneously as the pinch handler, and recognising a scroll most of the time, resulting in the pinch getting cancelled. on IOS, with the same code, its fine - the scrollview does not scroll while the pinch handler is interested in the gesture.

I do not have two gesture handlers active, which would cause this according to your documentation. Just a flatlist. Something wrong with android impl?

@stevenmathers
Copy link
Author

Lastly, I can confirm if I change the wrapped scrollView to a simple view, I see the expected behaviour - the pinch handler enters ACTIVE state and leaves as I would expect.

@jakub-gonet jakub-gonet added Platform: Android This issue is specific to Android Area: Gesture handlers This issue is related to problems with gesture handlers labels Sep 3, 2020
@ShaMan123
Copy link
Contributor

#1034

@jakub-gonet
Copy link
Member

Try using simultaniousHandlers after applying the #1034 patch – it should work.
If it's not, please post the repro code and we'll try to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Gesture handlers This issue is related to problems with gesture handlers Platform: Android This issue is specific to Android
Projects
None yet
3 participants