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

Input events should be instantiated with { composed: true } #1201

Open
mmun opened this issue Mar 3, 2022 · 2 comments
Open

Input events should be instantiated with { composed: true } #1201

mmun opened this issue Mar 3, 2022 · 2 comments

Comments

@mmun
Copy link
Member

mmun commented Mar 3, 2022

The composed property determines whether an event that occurs in shadow DOM will bubble to the host element.

Link to MDN docs.

In HTML, all form control input events are composed 1 2.

Presently, we are not instantiating input events with { composed: true }. See for example fillIn and select. I have not looked if there are other places. It probably makes sense to make this change in fireEvent itself similar to how bubbles is true by default.

Footnotes

  1. Search for "Fire an event named input" on https://html.spec.whatwg.org/multipage/input.html and https://html.spec.whatwg.org/multipage/form-elements.html.

  2. Change events are not composed.

@rwjblue
Copy link
Member

rwjblue commented Apr 11, 2022

Totally agree, thank you for noticing and reporting!

@mmun
Copy link
Member Author

mmun commented Apr 13, 2022

Here's a list of events that should be instantiated with { composed: true }:

WICG/webcomponents#513 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants