From 1e9fa63171bdc919507736300f98049cbdbc8006 Mon Sep 17 00:00:00 2001 From: Florian Bischof Date: Tue, 6 May 2025 19:53:22 +0200 Subject: [PATCH] Removes mozEvent warning (#9650) --- src/map/Map.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/map/Map.js b/src/map/Map.js index 314f79905..5c0c15f7b 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -1410,18 +1410,13 @@ export const Map = Evented.extend({ _fireDOMEvent(e, type, canvasTargets) { - if (e.type === 'click') { + if (type === 'click') { // Fire a synthetic 'preclick' event which propagates up (mainly for closing popups). // @event preclick: MouseEvent // Fired before mouse click on the map (sometimes useful when you // want something to happen on click before any existing click // handlers start running). - const synth = {}; - for (const i in e) { - synth[i] = e[i]; - } - synth.type = 'preclick'; - this._fireDOMEvent(synth, synth.type, canvasTargets); + this._fireDOMEvent(e, 'preclick', canvasTargets); } // Find the layer the event is propagating from and its parents.