Prevent touchmove event default when no preceding pointer event
Prevents zooming the page instead of the map on the first interaction
This commit is contained in:
@@ -277,7 +277,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
handleTouchMove_(event) {
|
handleTouchMove_(event) {
|
||||||
// Due to https://github.com/mpizenberg/elm-pep/issues/2, `this.originalPointerMoveEvent_`
|
// Due to https://github.com/mpizenberg/elm-pep/issues/2, `this.originalPointerMoveEvent_`
|
||||||
// may not be initialized yet when we get here on a platform without native pointer events.
|
// may not be initialized yet when we get here on a platform without native pointer events.
|
||||||
if (this.originalPointerMoveEvent_ && this.originalPointerMoveEvent_.defaultPrevented) {
|
if (!this.originalPointerMoveEvent_ || this.originalPointerMoveEvent_.defaultPrevented) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user