UNPKG

@base-ui/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

12 lines (11 loc) 514 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getElementAtPoint = getElementAtPoint; // `Document.elementFromPoint` retargets shadow content to the shadow host, which then fails // `contains()` checks against a popup inside that shadow root, so callers pass `getRootNode()` // (a document or a shadow root) rather than `ownerDocument()`. function getElementAtPoint(root, x, y) { return typeof root?.elementFromPoint === 'function' ? root.elementFromPoint(x, y) : null; }