From 6978c69f2099ff4d042cec43cac714524f909e8d Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 5 Nov 2019 09:53:33 +0100 Subject: [PATCH] Don't use instanceof HTMLElement in handleMapBrowserEvent Because not all elements in the DOM are instance of `HTMLElement`. For example, SVGs created with `document.createElementNS` are instances of `Element`. --- src/ol/PluggableMap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 75e8e204a8..eb13f51999 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -949,8 +949,8 @@ class PluggableMap extends BaseObject { // coordinates so interactions cannot be used. return; } - let target = mapBrowserEvent.originalEvent.target; - while (target instanceof HTMLElement) { + let target = /** @type {Node} */ (mapBrowserEvent.originalEvent.target); + while (target) { if (target.parentElement === this.overlayContainerStopEvent_) { return; }