react-native-gesture-handler
react-native-gesture-handler copied to clipboard
Make Gesture Handler on web respect `simultaneousHandlers` prop when used on a `ScrollView`
Description
Should fix https://github.com/software-mansion/react-native-gesture-handler/issues/2091
HammerJS (which is used by Gesture Handler on web) by default tries to use pointer events, which can be cancelled when the browser starts recognizing its own gestures (e.g. scrolling). Because of that all gestures would fail upon receiving pointercancel
event. This is not the case when using touch events, which do not get cancelled.
This PR forces Hammer to use touch events when a gesture is simultaneous with a NativeViewGestureHandler
and keeps its default behavior in other cases. This way the gesture keeps receiving events event when a browses is handling a gesture be itself.
Unfortunately, I don't think we can accomplish feature-parity between web and native platforms using Hammer. For example, one of the missing things is the possibility to prevent the scroll from starting.
Test plan
Tested on the Example app and on the code from the issue.
Oops, looks like the changes I've suggested are not formatted properly.