Skip to content

Commit

Permalink
fix(kit): use event-capturing mode when enable component highlighter (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzuodong committed Apr 2, 2024
1 parent e684caa commit 0f410e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/devtools-kit/src/core/component-highlighter/index.ts
Expand Up @@ -196,15 +196,15 @@ export function inspectComponentHighLighter() {
e.preventDefault()
e.stopPropagation()
selectComponentFn(e, (id: string) => {
window.removeEventListener('click', onSelect)
window.removeEventListener('click', onSelect, true)
window.removeEventListener('mouseover', inspectFn)
const el = getContainerElement()
if (el)
el.style.display = 'none'
resolve(JSON.stringify({ id }))
})
}
window.addEventListener('click', onSelect)
window.addEventListener('click', onSelect, true)
})
}

Expand Down

0 comments on commit 0f410e1

Please sign in to comment.