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
Element.matches producing false positives when using descendant combinators #614
Labels
bug
Something isn't working
Comments
IGx89
changed the title
Element.matches producing false positives when using descendent combinators
Element.matches producing false positives when using descendant combinators
Oct 12, 2022
IGx89
added a commit
to IGx89/happy-dom
that referenced
this issue
Oct 12, 2022
…endant combinators.
Yep! I have a PR coming shortly actually, would be here already but the pre-commit hooks take quite a while to complete on my machine :p. |
Nice ⭐ |
capricorn86
added a commit
that referenced
this issue
Oct 12, 2022
#614@patch: Element.matches not working properly with descendant combinators.
Thanks again for you contribution! it has been released: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using a descendant combinator (" ") with Element.matches, if the rightmost selector matches it always returns true regardless of the other selectors.
I ran into this bug when using vue-test-utils's Wrapper.findAll, which under the scenes uses Element.matches.
To Reproduce
Given the following HTML:
The following two statements, running on the innermost div (the one with class="active") both return true even though the second should return false:
Expected behavior
Invalid matches should always return false.
Device:
The text was updated successfully, but these errors were encountered: