From 869206b33db04925cfaea69269cc262e51ee78e2 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Thu, 10 Sep 2020 11:22:33 +0200 Subject: [PATCH] Only use elementFromPoint with ShadowRoot --- src/ol/PluggableMap.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 26ec858de6..d25adf8d21 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -1000,12 +1000,12 @@ class PluggableMap extends BaseObject { ? this.viewport_.getRootNode() : document; const target = - rootNode === document - ? /** @type {Node} */ (originalEvent.target) - : /** @type {ShadowRoot} */ (rootNode).elementFromPoint( + 'host' in rootNode // ShadowRoot + ? /** @type {ShadowRoot} */ (rootNode).elementFromPoint( originalEvent.clientX, originalEvent.clientY - ); + ) + : /** @type {Node} */ (originalEvent.target); if ( // Abort if the target is a child of the container for elements whose events are not meant // to be handled by map interactions.