MCPcopy Create free account
hub / github.com/Lobos/react-ui / isDescendant

Function isDescendant

src/utils/dom.js:11–22  ·  view source on GitHub ↗
(parent, child)

Source from the content-addressed store, hash-verified

9}
10
11export function isDescendant (parent, child) {
12 let node = child.parentNode;
13
14 while (node !== null) {
15 if (node === parent) {
16 return true;
17 }
18 node = node.parentNode;
19 }
20
21 return false;
22}
23
24export function offset (el) {
25 const rect = el.getBoundingClientRect();

Callers 1

getClickAwayEventMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…