mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.2k stars 2.22k forks source link

Android Chrome - prevent refreshing on touchmove #7290

Open KonWoj opened 6 years ago

KonWoj commented 6 years ago

Hi, I'm developing application that handle touchmove event, but when i tested it on android chrome it turned out that when i was moving finger down on screen it caused page to refresh. So my question is: is there a way to prevent such behaviour? I looked up similar issues, but the fix for those issues was setting css property touch-action: none on map container, but this prevents all touch actions when i simply want to overwrite touchmove event. Also i tried to call preventDefault on event object in touchmove callback, but i got message that preventDefault method is not defined

ryanhamley commented 6 years ago

Are you able to provide a minimal reproduction of the bug on JSBin? That would help a lot in determining what is happening.

KonWoj commented 6 years ago

sorry, i didn't get notification, here is sample code https://jsbin.com/juxaxec/edit?html,output it is just a example with draggin disabled and added touchmove handling