Replies: 2 comments
-
well, you can create a value with useRef, like below const isPinched = useRef(false); on PinchGestureHandler's onEnd callback , you can set it to true isPinched.current = true; inside your onPress function , you can tell if user pinched before, not pinched, trigger your function const onPress = () => {
if (isPinched.current) {
isPinched.current = false;
return;
}
// no pinch , just tap
// run your onPress code here
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
by the way , in the latest RNGH , you can use Gesture.Race to achieve the result. Only one gesture will activate one time. If you pinched , the tap gesture won't activate . If you tap (allow multiple fingers) , the pinch gesture won't activate. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Helll friends, faced a problem with
<PinchGestureHandler>
which wraps big<Pressable>
area. After finishing pinching event it's trigger<Pressable>
handler (because of finger/fingers staying on it after pinch gesture) and i cannot prevent it. And If it is not difficult for you, please explain how we can prevent this. And how the events triggered in the react native. Because on the web there is such a thing as capturing and bubbling..Beta Was this translation helpful? Give feedback.
All reactions