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`.
This commit is contained in:
Frederic Junod
2019-11-05 09:53:33 +01:00
parent 146e38c7ef
commit 6978c69f20

View File

@@ -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;
}