emberjs / emberjs/ember-test-helpers
Input events should be instantiated with `{ composed: true }`
- Dominant language
- JavaScript
- Stars
- 188
- Forks
- 254
- PR merge metrics
- No merged PRs in 30d
Description
The `composed` property determines whether an event that occurs in shadow DOM will bubble to the host element.
[Link to MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/Event/composed).
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](https://github.com/emberjs/ember-test-helpers/blob/v2.6.0/addon-test-support/@ember/test-helpers/dom/fill-in.ts#L75) and [select](https://github.com/emberjs/ember-test-helpers/blob/v2.6.0/addon-test-support/%40ember/test-helpers/dom/select.ts#L93). 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.
[^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.
Contributor guide
Assessment
This issue has not been assessed yet.