react-native-swipe-gestures
react-native-swipe-gestures copied to clipboard
Gesture don't work on Model
I have added a down gesture to a model, and it doesn't recognize it
@intellij-Shivam have got any solution for this?
Guys, take a look at this https://github.com/facebook/react-native/issues/14295#issuecomment-374012339. This package is based on PanResponder, so all you have to do is this:
render() {
/**
* Im using the TouchableWithoutFeedback with its View as a workaround
* so that this component is swipable even when it is inside a modal,
* because modals do not release their responder properly.
*/
return (
<Modal>
<View>
<GestureRecognizer {...props}>
<TouchableWithoutFeedback>
<View>
// The component's content goes here
</View>
</TouchableWithoutFeedback>
</GestureRecognizer>
</View>
</Modal>
);
}
This worked for me (:
You need to wrap your Modal component with GestureRecognizer like so
<GestureRecognizer {...props}>
<Modal>
// other code
</Modal>
</GestureRecognizer>