Closed philvoyer closed 3 years ago
Does anyone have a similar problem, of a minimalist example of a working double tap gesture ?
I got the same problem.
I have two scrollviews nested under a pageviewer. Two scrollviews are almost identical except the image attached to the scrollview are different. I use double to enlarge the image to the location where users tap. A few days ago, it worked completely fine. While I revisited the code and do some modifications today, it completely failed.
I move back to the first step and try the simple code in the documentation. It works at first. Once I swipe to another scrollview and move back to the first scrollview, it can only detect single tap. Magically, the second scrollview works completely fine with double tap. If I restart expo client and reload the app, it seems to work at first and the same problem appears again after I swipe to other scrollviews.
I also tried a long list of scrollviews. The double tap only works on the last scrollviews.
Tried on both iphone and ipad, same problem happened.
A workaround can be to compare the a time threshold between 2 single taps.. but it defeats the purpose of using this library for double tap gestures.
Does anyone have similar problem or a solution ?
I finally make my code work. I use hook in create reference. I wrap TapGestureHandler in a PageViewer. Instead of one single reference, I need an array of references, each assigns to one single page. The following is my code.
// page is my variable
const doubleTapRef: any = useRef(page.map(() => createRef()));
...
<TapGestureHandler
waitFor={doubleTapRef.current[index]}>
<TapGestureHandler
ref={doubleTapRef.current[index]}>
...
</TapGestureHandler>
</TapGestureHandler>
For your information, the problem disappears after upgrading to expo SDK40, which has the side effect of upgrading react-native-gesture-handler from 1.6.0 to 1.8.0.
react-native-gesture-handler: v1.10.0 Project examples are not working on iOS devices (just tested on iOS simulator) and not working on Snack as well Double tap not working => always activate single tap
react-native-gesture-handler: v1.10.3 => double tap working
Upgraded with 1.10.3 and still get the issue. The official demo randomly works with 2 fingers, not at all with one (on iPad)
"Funny" fact : If i don't set minPointers prop then i need 2 fingers to trigger the handler (default value seems to be 1 based on documentation) If i set minPointers prop to 1 then i still need 2 fingers to trigger the handler If i set minPointers prop to 2 then i need 3 fingers to trigger the handler If i set minPointers prop to 3 then i need 4 fingers to trigger the handler (that's a little bit difficult to double 4-fingers tap)
Description
The
TapGestureHandler
seems to have a bug with multitap.It is now impossible to do a double tap with only one finger, it now requires two fingers to be detected.
Steps To Reproduce
multitap
demo from Example project.Expected behavior
Double tap with only one finger.
Actual behavior
Double tap is only possible with two fingers.
Snack or minimal code example
Can be reproduce in the
react-native-gesture-handler
demo :https://snack.expo.io/@adamgrzybowski/react-native-gesture-handler-demo