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

Conditional default prevention instead of touch-action: none #10332

Merged
merged 1 commit into from
Nov 29, 2019

Conversation

ahocevar
Copy link
Member

@ahocevar ahocevar commented Nov 24, 2019

With this pull request, users get more fine-grained control over default prevention on touch devices. Previously, we always set the touch-action: none css property on the viewport, which prevents the default on all touch events. This is not desired for maps embedded on scrollable pages. Now we don't set touch-action any more. Instead, the DragPan interaction calls preventDefault() on touchmove. With this change, users can configure DragPan with a condition that checks for the number of pointers (with its new getPointerCount() method), and only handle the event when more than one finger is used.

This change also removes the no longer needed, only recently introduced code (#10187) that changes the touch-action css property on the viewport dynamically.

Fixes #9936.

@ahocevar ahocevar force-pushed the no-touch-action-css branch 3 times, most recently from 23070c3 to 243686f Compare November 25, 2019 00:07
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.

DragPan & Scroll behaviour mobile/desktop
3 participants