We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaed61f commit 925f83fCopy full SHA for 925f83f
libs/engine/src/app/components/picker-highlighter.tsx
@@ -7,15 +7,14 @@ const DEFAULT_INACTIVE_BORDER_COLOR = '#384BFF4D' // light blue
7
const DEFAULT_CHILDREN_BORDER_STYLE = 'dashed'
8
const PRIVILEGED_NAMESPACE = 'mweb' // ToDo: hardcode. Needs to be fixed.
9
10
-const getElementDepth = (el: Element | Node) => {
+const getElementDepth = (el: Element | ShadowRoot | null | undefined) => {
11
let depth = 0
12
- let host = (el as any).host
13
- while (el.parentNode !== null || host) {
14
- if (host) el = host as Node
15
- el = el.parentNode!
16
- host = (el as any).host
+
+ while (el) {
17
depth++
+ el = el instanceof ShadowRoot ? el.host : el.parentElement
18
}
19
return depth
20
21
0 commit comments