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

onGestureEvent on TapGestureHandler

Open rvolution opened this issue 7 years ago • 6 comments

Can someone confirm if the onGestureEvent property can be used on a TapGestureHandler?

onHandlerStateChange works fine, but onGestureEvent does not seem to fire.

In the docs where it describes the "Common handler properties" it says:

This section describes properties that can be used with all gesture handler components

rvolution avatar Feb 27 '19 21:02 rvolution

I'm experiencing the same problem

ethanshar avatar Mar 29 '19 07:03 ethanshar

+1

npapakha avatar Apr 23 '19 18:04 npapakha

same

kristianhasselknippe avatar Aug 28 '19 15:08 kristianhasselknippe

onGestureEvent doesn't work on TapGestureHandler due to the fact that tapping is a discrete gesture which means that it doesn't send a continuous stream of gestureEvents. I agree that documentation is kinda imprecise on that but we can improve that :>

jgonet avatar Sep 08 '20 18:09 jgonet

@jakub-gonet just to clarify, for <TapGestureHandler> we should instead only listen to onHandlerStateChange and run our actions there, right? Why not remove onGestureEvent from the <TapGestureHandler> entirely?

mrousavy avatar Nov 23 '20 16:11 mrousavy

Right.

I'm pretty sure we can remove this callback. It wasn't done earlier because it's simpler to inherit base properties in impl than customize them, but I think it can be done without breaking anything so I may get around it eventually.

jgonet avatar Nov 23 '20 17:11 jgonet