react-native-swipe-gestures
react-native-swipe-gestures copied to clipboard
Cannot detect any swipes
Cannot detect any swipes on ios simulator / react-native 0.44.0
hmm, it works but for some reason doesn't work on react modal
Doesn't work for react modal.
It s an open issue on react native for detecting the swipes inside the Modal. https://github.com/facebook/react-native/issues/14295#issuecomment-315777517
+1 still not working on .49
+1 still not working on 0.52.0
workaround is to wrap modal content with Touchable component
<TouchableWithoutFeedback>
<View>
// The component's content goes here
<GestureRecognizer
onSwipe={(direction, state) => this.onSwipe(direction, state)}
onSwipeUp={(state) => this.onSwipeUp(state)}
onSwipeDown={(state) => this.onSwipeDown(state)}
onSwipeLeft={(state) => this.onSwipeLeft(state)}
onSwipeRight={(state) => this.onSwipeRight(state)}
config={config}
>
<Text>{this.state.myText}</Text>
<Text>onSwipe callback received gesture: {this.state.gestureName}</Text>
</GestureRecognizer>
</View>
</TouchableWithoutFeedback>
It't old and not working in my phone.
wrapping with Touchable didn't work for me inside modal ?
any update since ? thank you
I had trouble with ImageBackground in Modal. Work for me well, but TouchableWithoutFeedback was inside GestureRecognizer, as wrapper of ImageBackground.
I had trouble with ImageBackground in Modal. Work for me well, but TouchableWithoutFeedback was inside GestureRecognizer, as wrapper of ImageBackground.
Thanks @BuraVadim - your fix worked for me as well. Working code below:
<GestureRecognizer
onSwipeUp={() => {}}
config={config}
>
<TouchableWithoutFeedback>
<View>
<FontAwesomeIcon
icon={faAngleDoubleUp}
style={{ color: Colors.yellow.medium, margin: 10 }}
size={20}
/>
<Text style={[styles.h3, { color: Colors.yellow.medium }]}>
Text goes here
</Text>
</View>
</TouchableWithoutFeedback>
</GestureRecognizer>