React-native-gesture-handler: Position on Tap / LongPress

Created on 10 Aug 2018  路  6Comments  路  Source: software-mansion/react-native-gesture-handler

I have the following use case: a chart scrubber that activates on long press.

This works on iOS where x/y is provided, but as discussed here those are not supported properties and do not work on android: https://github.com/kmagiera/react-native-gesture-handler/issues/187

I understand how to use a PanGH to handle the scrub on drag but it appears there may be no way to get the on press position in order to draw the scrubber from the LongPressGH. Thus a move is required before the PanGH activates and can draw the correct scrubber.

Is there any way to solve this in RNGH?

All 6 comments

AFAIK https://github.com/kmagiera/react-native-gesture-handler/blob/master/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java#L189
Tap has already X, Y, etc. and it will documented soon.
I've also added this options to LongPress

Already done 馃憤

Could we get a new release to make this available?

TypeScript definitions are not updated 馃檪

@alamothe would you like to do it?

run the multitap example in my iPhone 8+锛宎nd the single tap gesture event always gives me {x:0,y:0}
remove the doubletap GestureHandlder gives me right position

Was this page helpful?
0 / 5 - 0 ratings