software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.12k stars 980 forks source link

PanGesture inside FlatList #1070

Closed maitriyogin closed 4 years ago

maitriyogin commented 4 years ago

Hi, just wanted to post a quick question before submitting an example. I have a FlatList (from RNGH), each item is wrapped in a PanGestureHandler, to accomplish swipe. The issue is that the PGH eats all the events so the scroll on the FlatList is broken.

So.. my question is: if the PGH can waitFor a ref of the FlatList?

In all my experiments it just doesn't seem to do it... I've tried with useRef, createRef and a call-back ref, also with passing in flatListRef.getScrollResponder() ... but to no avail.

My current work around is to failOffsetY={[-2,2]} on the PGH, works but is slightly sticky ..

so, can you PGH.waitFor on a RNGH FlatList or ScrollView ref ??

Huge thanks for any guidance, Stephen.

jakub-gonet commented 4 years ago

This issue was not active for some time so I'm closing it. If you need further help please reply.