This repository was archived by the owner on Jun 20, 2025. It is now read-only.
Commit a8e8764
authored
Pierce ShadowRoot boundary when getting ancestry (#486)
* Pierce ShadowRoot boundary when getting ancestry
With on-demand ShadyDOM, the DOM is rendered without shadow nodes, but the API acts as if these shadow nodes exist. This can cause issues with getFocusedPath calls where the activeElement is inside of a "shadow node", thus getting the ancestry of the activeElement to the root results in an assertion error because `n.parentNode` returns undefined. We can get around this by piercing through the shadow node boundary.
This should only affect on-demand ShadyDOM since for regular ShadowDOM, the `!node.contains(activeElement)` check would be true causing getFocusedPath to short circuit.
* Remove unecessary optional chaining1 parent febf3c9 commit a8e8764
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
0 commit comments