react-native-gesture-handler
react-native-gesture-handler copied to clipboard
LongPressGestureHandler does not work with numberOfPointers > 1
I'm attempting to use LongPressGestureHandler
to detect both single and two finger long presses. It works fine with single finger, but when using two fingers (either in iOS simulator or on an iOS device) the onHandlerStateChange is never called. My code looks basically like:
<LongPressGestureHandler
onHandlerStateChange={(event) => { console.debug(event.nativeEvent) }} >
<View style={{ flex: 1 }} />
</LongPressGestureHandler>
I'm able to work around the issue, by using <TapGestureHandler />
and then setting maxDurationMs
and checking for State.FAILED
, but it'd be nice if I could just use LongPressGestureHandler
.
Environment Info react-native-gesture-handler: 1.6.1 react: 16.11.0 react-native: 0.62.2
Same problem for me, really appreciate you mentioning the workaround!
Hi! If you need this feature you could implement it yourself using manual gesture - https://docs.swmansion.com/react-native-gesture-handler/docs/manual-gestures/manual-gestures. At the moment, I can't say whether it will be implemented in LongPressGestureHandler
.