@base-ui-components/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.
16 lines (15 loc) • 480 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findRootOwnerId = findRootOwnerId;
var _dom = require("@floating-ui/utils/dom");
function findRootOwnerId(node) {
if ((0, _dom.isHTMLElement)(node) && node.hasAttribute('data-rootownerid')) {
return node.getAttribute('data-rootownerid') ?? undefined;
}
if ((0, _dom.isLastTraversableNode)(node)) {
return undefined;
}
return findRootOwnerId((0, _dom.getParentNode)(node));
}