Merge pull request #11549 from ahocevar/no-root-node

Only use elementFromPoint with ShadowRoot
This commit is contained in:
Andreas Hocevar
2020-09-11 09:41:52 +02:00
committed by GitHub

View File

@@ -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.