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

Fix visible to work with elements in the Shadow DOM #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eKoopmans
Copy link

As a follow-up to #63 and #64, this applies the same shadow DOM fix for visible.

I have modified the check for both displayed and visible to restore backwards-compatibility: on older browsers that don't support .getRootNode, it'll fall back to the older check of document.body.contains(el).

I also modified the test from #64, which was returning false positives (passing both before and after the fix). The new test successfully passes with the fixes, and fails without the fixes.

@jpzwarte
Copy link
Contributor

jpzwarte commented Sep 7, 2023

Looks good!

@eKoopmans
Copy link
Author

@nathanboktae this will bring visible into parity with displayed - let me know if there's any changed you'd like.

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 this pull request may close these issues.

2 participants