From f4c148f51fb829441d6e81dafc9b8123003438d9 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 9 Apr 2020 16:33:55 -0400 Subject: [PATCH] fix #9519 click map event on touch devices (#9526) --- src/ui/handler/tap_recognizer.js | 1 - src/ui/handler/tap_zoom.js | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/handler/tap_recognizer.js b/src/ui/handler/tap_recognizer.js index 1d9f11121a1..40328e19764 100644 --- a/src/ui/handler/tap_recognizer.js +++ b/src/ui/handler/tap_recognizer.js @@ -125,7 +125,6 @@ export class TapRecognizer { this.lastTap = tap; if (this.count === this.numTaps) { - e.preventDefault(); this.reset(); return tap; } diff --git a/src/ui/handler/tap_zoom.js b/src/ui/handler/tap_zoom.js index 060a40af9d8..0249c1069e9 100644 --- a/src/ui/handler/tap_zoom.js +++ b/src/ui/handler/tap_zoom.js @@ -47,6 +47,7 @@ export default class TapZoomHandler { if (zoomInPoint) { this._active = true; + e.preventDefault(); setTimeout(() => this.reset(), 0); return { cameraAnimation: (map: Map) => map.easeTo({ @@ -57,6 +58,7 @@ export default class TapZoomHandler { }; } else if (zoomOutPoint) { this._active = true; + e.preventDefault(); setTimeout(() => this.reset(), 0); return { cameraAnimation: (map: Map) => map.easeTo({