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

Fix touch panning in Edge #6325

Merged
merged 2 commits into from
Mar 14, 2018
Merged

Fix touch panning in Edge #6325

merged 2 commits into from
Mar 14, 2018

Conversation

jfirebaugh
Copy link
Contributor

@jfirebaugh jfirebaugh commented Mar 13, 2018

Touch events are behind a flag in Edge, even on touchscreen devices. 🤷‍♂️ However, Edge will dispatch mouse events in response to touch input -- in certain circumstances which are not well documented. It seems that it depends on the touch-action CSS property being present on particular elements. We previously set touch-action: none on the .mapboxgl-canvas-container element, but this is apparently not enough for Edge. In my tests setting touch-action: none on the body element works, as does setting touch-action: none on both the canvas container and the canvas. Since we don't want to affect touch-action on the entire page, here's the latter solution.

Note that this doesn't fix pinch zooming or touch rotating. Until touch events are unflagged by default, the only way to support those is via pointer events.

Refs #1928.

-ms- prefix is necessary only for IE10, which is not supported by GL JS.
Copy link
Contributor

@mollymerp mollymerp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this down @jfirebaugh. Are you removing -ms-touch-action because IE 11 supports touch-action?

@jfirebaugh
Copy link
Contributor Author

Yep, the -ms- prefix is necessary only for IE10.

@jfirebaugh jfirebaugh merged commit 10d636f into master Mar 14, 2018
@jfirebaugh jfirebaugh deleted the edge-pan branch March 14, 2018 15:53
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.

2 participants