-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Set touch-action: none
on the map container
#4259
Comments
Could be related to the issue React has with recent Chrome (56): facebook/react#8968 |
@Scarysize good find -- that appears to be the likely culprit. Our Aside from those, I think we should also do an audit of any other touch event handlers we register and determine whether we (a) are using |
@anandthakker Was this something that you guys figured out? I'm still consoling errors in my application. Thanks! |
@anandthakker possibly related to this is the fact that mapbox-gl-js stopped correctly working with windows 10 mult-touch gestures at some point not long ago. E.g. the demo at https://www.mapbox.com/mapbox-gl-js/examples/ will scale the entire page if I attempt to pinch to zoom in (although zoom out works correctly), and will also invoke chrome 'go back' gesture if I try to pan the map to the right. Both of these scenarios worked fine a couple months ago, possible regression? |
We ran into this issue preparing for a trade show last week using some Win10 touch kiosks. In order to keep touch events ultra-responsive the standards-makers are proposing and appearing to move to disallow 'active' event handlers -- that is to say that javascript event handlers will only process asyncronously with whatever the native touch handler is doing (zoom, pan, scroll, etc.) The way to stop the native handlers is to set the touch-action: none in the CSS; this seems to be a good overall workaround unless you want to still support touch scrolling of the page until the map is 'activated' by a tap or something. Chrome 56 also has a bug where touch-action: none does not stop all instances of pinch-zoom. It's fixed in Chrome 57, currently in the Beta channel. There is absolutely no workaround that can be done in js/css/html for Chrome 56. The only fix is to completely disable pinch zoom via commandline argument. I noticed but did not investigate why the touch events dont work at all in Edge anymore (did they ever?) |
Interesting. Well thank you guys for the information. It's not the biggest issue, it's honestly just a bit annoying on mobile. Hopefully Chrome 57 will fix this. |
@kavada it is a big issue for me in a fullscreen app on a touch table. While zooming the map GUI-Elements get zoomed as well until they are out of the viewport. |
{passive: false}
for any touch event handlers that use preventDefault
{passive: false}
for any touch event handlers that use preventDefaulttouch-action: none
on the map container
Retitling to reflect the preferred solution of using Note that we should not unconditionally set |
Linking upstream issue for reference: WICG/interventions#18 |
@bicubic .... YES Thank you! |
mapbox-gl-js version:
Steps to Trigger Behavior
Expected Behavior
Move fluid
Actual Behavior
Moves slow, clunky
The text was updated successfully, but these errors were encountered: