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

[synthetic-shadow] Non-composed bubbling events are not properly filtered #2121

Closed
ekashida opened this issue Dec 5, 2020 · 1 comment · Fixed by #2226
Closed

[synthetic-shadow] Non-composed bubbling events are not properly filtered #2121

ekashida opened this issue Dec 5, 2020 · 1 comment · Fixed by #2226
Labels
natively-available This represents work that would involve polyfilling of natively implemented features

Comments

@ekashida
Copy link
Member

ekashida commented Dec 5, 2020

Description

Only instances of host elements and shadow roots properly filter non-composed events. All other EventTarget instances have access to non-composed events, even when they should not. This includes window, document, and document.documentElement.

This bug affect events that are configured to bubble without being composed. Explicitly speaking, events with this configuration were never supposed to propagate past the immediate shadow root, but this is what is currently happening.

To understand the impact of a fix, we could also try to understand which native events are configured this way.

Non-comprehensive list of native events that bubble but are not composed:

  • change
  • submit

Steps to Reproduce

https://developer.salesforce.com/docs/component-library/tools/playground/hQ5yrr-hb/1/edit

Browsers Affected

All browsers.

Version

v0.37.0

Possible Solution

Introduce the same non-composed event filtering we do for listeners on host elements and root nodes to wrapped listeners generated by EventTarget.prototype.addEventListener.

@ekashida
Copy link
Member Author

ekashida commented Dec 5, 2020

#1138 should probably be addressed at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
natively-available This represents work that would involve polyfilling of natively implemented features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant