| Summary: | HTMLSelectElement's change event does not have composed true set | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Elliott Marquez <emarquez> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | akeerthi, megan_gardner, wenson_hsieh |
| Priority: | P2 | ||
| Version: | Safari 14 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
The WHATWG concluded that the `change` event should not be composed. [1] Our behavior matches Chrome and Firefox. [1] https://github.com/whatwg/html/issues/5453#issuecomment-885222243 |
The `change` event on HTMLSelectElement has {bubbles: true, composed: false} unlike the `input` event which has `{bubbles: true, composed: true}` This means that if someone wants to listen for the change event from a <select> inside of the shadow root of a custom element, then it will not propagate through the composed shadow tree. Live repro: https://jsbin.com/zahocodiwo/edit?html,output Steps to repro: 1. Place a <select> element with <option>s inside a shadow root 2. Add an event listener for the `change` event on the shadow root host 3. toggle between options in the <select> 4. observe that the `change` event listener is not called. Expected behavior: the event listener is called and the change event has `composed: true` Actual behavior: The event listener is not called and the change event has `composed: false`