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

Make Gesture Handler on web respect `simultaneousHandlers` prop when used on a `ScrollView`

Open j-piasecki opened this issue 1 year ago • 1 comments

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.

j-piasecki avatar Jul 14 '22 11:07 j-piasecki

Oops, looks like the changes I've suggested are not formatted properly.

tomekzaw avatar Aug 03 '22 07:08 tomekzaw