Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call onDrag when multiple fingers are touching the map #972

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trygveaa
Copy link

Calling onDrag when multiple fingers are touching the map causes a delay
when you start pinch zooming. This is because the pinch is interpreted
as a tap in the beginning, which causes stopPropagation to be called.

I think dragging is an action you only do with one finger, so therefore
I think not calling onDrag is the correct solution to this.

I'm not sure how to test this, as I haven't figured out how to check if events are called. Are there any existing tests doing such checks?

Fixes #962

Calling onDrag when multiple fingers are touching the map causes a delay
when you start pinch zooming. This is because the pinch is interpreted
as a tap in the beginning, which causes stopPropagation to be called.

I think dragging is an action you only do with one finger, so therefore
I think not calling onDrag is the correct solution to this.

Fixes mapbox#962
@karimnaaji karimnaaji closed this Jun 16, 2020
@karimnaaji karimnaaji reopened this Jun 16, 2020
@arindam1993 arindam1993 changed the base branch from master to main June 17, 2020 01:23
@underbluewaters
Copy link

I've used this approach in my own fork to avoid wrecking a shape that's in direct_select mode while pinch-zooming on a mobile device. I'm finding editing on mobile to be pretty impossible without that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When plugin enable there is a significant delay when initiating zoom with 2 finger pinch on mobile devices
4 participants