(node: DOMElement)
| 164 | * the FocusManager — like browser's `node.getRootNode()`. |
| 165 | */ |
| 166 | export function getRootNode(node: DOMElement): DOMElement { |
| 167 | let current: DOMElement | undefined = node |
| 168 | while (current) { |
| 169 | if (current.focusManager) return current |
| 170 | current = current.parentNode |
| 171 | } |
| 172 | throw new Error('Node is not in a tree with a FocusManager') |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Walk up to root and return its FocusManager. |
no outgoing calls
no test coverage detected