react-native-swipe-gestures
react-native-swipe-gestures copied to clipboard
Flatlist inside Gesture recognizer not working on iOS
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!
I'm having the same issue!
Same here.
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?
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?
@thegamenicorus has a solution here: https://github.com/glepur/react-native-swipe-gestures/issues/16#issuecomment-344181328
Same issue coming at my side. Any idea?
@thegamenicorus has a solution here: #16 (comment) Doesn't help any more(
@thegamenicorus has a solution here: #16 (comment)
Didn't work for me. Any find a solution/workaround?
@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 👏
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.
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> ) }
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