react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

LongPressGestureHandler does not work with numberOfPointers > 1

Open jd20 opened this issue 4 years ago • 2 comments

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

jd20 avatar May 23 '20 18:05 jd20

Same problem for me, really appreciate you mentioning the workaround!

Klemminn avatar Apr 15 '21 16:04 Klemminn

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.

j-piasecki avatar Mar 31 '22 10:03 j-piasecki