MCPcopy Create free account
hub / github.com/editablejs/editable / inAbsoluteDOMElement

Function inAbsoluteDOMElement

packages/editor/src/utils/dom.ts:126–140  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

124}
125
126export const inAbsoluteDOMElement = (value: any): boolean => {
127 if (isDOMHTMLElement(value)) {
128 let node: HTMLElement | null = value
129 while (node) {
130 const attributeNames = node.getAttributeNames()
131 if (attributeNames.some(name => Constants.dataNode === name)) return false
132 const styles = getComputedStyle(node)
133 if (~['absolute', 'fixed'].indexOf(styles.position)) {
134 return true
135 }
136 node = node.parentElement
137 }
138 }
139 return false
140}

Callers 2

handleRootTouchStartFunction · 0.90
handleRootMouseDownFunction · 0.90

Calls 1

isDOMHTMLElementFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…