Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

displayed doesn't work with elements in the Shadow DOM #63

Closed
jpzwarte opened this issue Mar 6, 2023 · 0 comments · Fixed by #64
Closed

displayed doesn't work with elements in the Shadow DOM #63

jpzwarte opened this issue Mar 6, 2023 · 0 comments · Fixed by #64

Comments

@jpzwarte
Copy link
Contributor

jpzwarte commented Mar 6, 2023

document.body.contains(el) always returns false for elements inside the Shadow DOM. The fix is to use el.getRootNode({ composed: true }) === document instead.

See open-wc/open-wc#2583

Do you accept a PR for this? If so, I can create one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant