Make Gesture Handler on web respect simultaneousHandlers
prop when used on a ScrollView
#2125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Should fix #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.