@qvant/qui-max
Version:
A Vue 3 Design system for Web.
19 lines (18 loc) • 501 B
JavaScript
import { isShadowRoot } from "./instanceOf.js";
function contains(parent, child) {
var rootNode = child.getRootNode && child.getRootNode();
if (parent.contains(child)) {
return true;
} else if (rootNode && isShadowRoot(rootNode)) {
var next = child;
do {
if (next && parent.isSameNode(next)) {
return true;
}
next = next.parentNode || next.host;
} while (next);
}
return false;
}
export { contains as default };
//# sourceMappingURL=contains.js.map