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

#622@patch: Fix Element.matches failing when using non-matching desce… #625

Conversation

IGx89
Copy link
Contributor

@IGx89 IGx89 commented Oct 18, 2022

…ndant selector on element detached from document.

Fixes second issue reported under #622

…ching descendant selector on element detached from document.
};
}

if (!currentNode.parentElement || (targetNode === currentNode && !result.matches)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored slightly to always verify parentElement is not null, making it pass null checks in case you ever turn on strictNullChecks.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that would be good to turn on 🙂

@capricorn86 capricorn86 merged commit 999cd31 into capricorn86:master Oct 18, 2022
@IGx89 IGx89 deleted the task/622-fix-matches-non-matching-descendant-selector branch October 18, 2022 15:18
@RahulNearSt
Copy link

I was using TableCell from materialUI-core and experiencing this issue until your fix. Thanks for the quick fix and release!

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.

None yet

3 participants