react-native-swipe-gestures icon indicating copy to clipboard operation
react-native-swipe-gestures copied to clipboard

Flatlist inside Gesture recognizer not working on iOS

Open hamzaehsan95 opened this issue 6 years ago • 12 comments

When I set the flat list inside the gesture recognizer, It works fine on android but flatlist is not able to scroll on iOS..Any help please!

hamzaehsan95 avatar Mar 04 '19 05:03 hamzaehsan95

I'm having the same issue!

bobber205 avatar Apr 02 '19 22:04 bobber205

Same here.

olinations avatar Apr 12 '19 00:04 olinations

When making ScrollView a child of a GestureRecognizer this causes the same problem. The answer for that was to switch the order, ie. make the GestureRecognizer a child of the ScrollView. How can we do the same thing for FlatList?

olinations avatar May 16 '19 06:05 olinations

Same issue here. I need GestureRecognizer to be the parent. There is a ScrollView as a children somewhere down the tree, but it doesn't work. My scenario is not hard, I need GesturaRecognizer to listen to right and left swipes but ignore up and down and leave it to the ScrollView to handle those naturally. Any ideas?

matheusbaumgart avatar Jun 02 '19 21:06 matheusbaumgart

@thegamenicorus has a solution here: https://github.com/glepur/react-native-swipe-gestures/issues/16#issuecomment-344181328

matheusbaumgart avatar Jun 02 '19 21:06 matheusbaumgart

Same issue coming at my side. Any idea?

ManishKumarPandia avatar Jul 22 '19 21:07 ManishKumarPandia

@thegamenicorus has a solution here: #16 (comment) Doesn't help any more(

Vladislava9009 avatar Nov 06 '19 08:11 Vladislava9009

@thegamenicorus has a solution here: #16 (comment)

Didn't work for me. Any find a solution/workaround?

dooleyb1 avatar Jan 31 '20 21:01 dooleyb1

@thegamenicorus has a solution here: #16 (comment)

Didn't work for me. Any find a solution/workaround?

Okay take this back, didn't realise it was a fork. Worked perfectly 👏

dooleyb1 avatar Jan 31 '20 21:01 dooleyb1

For anyone looking out for a solution, you can try this library: https://www.npmjs.com/package/rn-swipe-gestures It's basically a clone of react-native-swipe-gestures. The only difference is you can add props to the config such as detectSwipeUp, detectSwipeDown, etc. This will solve your problem.

RazaShehryar avatar Mar 22 '21 08:03 RazaShehryar

Guys, I have inserted GestureRecognizer INSIDE renderItem of Flatlist, and it worked both in Android and iOS. Flatlist cells movable up and down , also gesture recognizer works left and right.

Try it~

renderItem = (data) => { const gestureConfig = { velocityThreshold: 0.3, directionalOffsetThreshold: 80 }; return ( <GestureRecognizer onSwipeLeft={(state) => this.onSwipeLeft(state)} onSwipeRight={(state) => this.onSwipeRight(state)} config={gestureConfig} style={{flex: 1}} > <TouchableOpacity oppress = {}> <Text>test</Text> </TouchableOpacity> </GestureRecognizer> ) }

HisonKahng avatar Apr 28 '21 16:04 HisonKahng

For anyone looking out for a solution, you can try this library: https://www.npmjs.com/package/rn-swipe-gestures It's basically a clone of react-native-swipe-gestures. The only difference is you can add props to the config such as detectSwipeUp, detectSwipeDown, etc. This will solve your problem.

I installed this library and the interface for the GestureRecognizerConfig didn't contain those properties to detect swiping up or down (detectSwipeUp). I have not found a react native solution for a ScrollView inside the GestureRecognizer

cs-manughian avatar Mar 03 '22 22:03 cs-manughian