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

#709@patch: Properly detect ShadowRoot boundary when constructing composedPath #710

Conversation

romansp
Copy link
Contributor

@romansp romansp commented Feb 1, 2023

Fixes #709.

Not exactly sure about this instanceof ShadowRoot check with an extra import as I couldn't find other similar usages the codebase. Will be happy to update this PR If there's a more desirable pattern.

…ot in more places where the host property is used.
@capricorn86
Copy link
Owner

Thank you for your contribution @romansp! ⭐

Good that you found this bug 😅

The biggest reason for avoiding checking with instanceof is to avoid the import as it very easy becomes circular dependencies because of the nature of the DOM (Document -> Node -> Document -> Node).

I have made a commit which checks with nodeType and I also found a couple of more places with similar problems. It should solve the problem even if it would be even better to check specifically for "ShadowRoot".

@capricorn86 capricorn86 merged commit 8cd5a95 into capricorn86:master Feb 2, 2023
@romansp romansp deleted the task/709-composedPath-for-anchor-element branch February 14, 2023 17:47
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.

composedPath is incorrect for composed bubbling events originating from HTMLAnchorElement
2 participants