@spectrum-web-components/shared
Version:
Shared mixins, tools, etc. that support developing Spectrum Web Components.
14 lines (13 loc) • 414 B
JavaScript
;
export const getDeepElementFromPoint = (x, y) => {
let target = document.elementFromPoint(x, y);
while (target == null ? void 0 : target.shadowRoot) {
const innerTarget = target.shadowRoot.elementFromPoint(x, y);
if (!innerTarget || innerTarget === target) {
break;
}
target = innerTarget;
}
return target;
};
//# sourceMappingURL=get-deep-element-from-point.dev.js.map