Bug 231194 - HTMLSelectElement's change event does not have composed true set
Summary: HTMLSelectElement's change event does not have composed true set
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 14
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-04 15:30 PDT by Elliott Marquez
Modified: 2021-10-05 10:13 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Marquez 2021-10-04 15:30:16 PDT
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`
Comment 1 Aditya Keerthi 2021-10-05 10:13:57 PDT
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