You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
interfaceCustomEvent<T=any>extendsEvent{/** * Returns any custom data event was created with. * Typically used for synthetic events. */readonlydetail: T;initCustomEvent(typeArg: string,canBubbleArg: boolean,cancelableArg: boolean,detailArg: T): void;}
However, emitting a primitive value for an event detail is not future-resistant. If we ever need to pass more data, we'll be forced to break backward compatibility for a large number of customers.
Solution
Rather than break backward compatibility later—after lots of downstream consumers have already wrapped the new v0.44.0 MDCList API from PR #4144—we should break it now.
Problem
We're currently emitting a
numbervalue for theCustomEvent.detailproperty inMDCListAdapter.notifyAction():material-components-web/packages/mdc-list/index.js
Lines 279 to 281 in af950fc
This is technically allowed by TypeScript's
CustomEvent<T>interface:https://github.com/Microsoft/TypeScript/blob/2f9218f346bbc606cccc4aebfca1c2c4f3167fee/lib/lib.dom.d.ts#L3415-L3422
However, emitting a primitive value for an event
detailis not future-resistant. If we ever need to pass more data, we'll be forced to break backward compatibility for a large number of customers.Solution
Rather than break backward compatibility later—after lots of downstream consumers have already wrapped the new v0.44.0
MDCListAPI from PR #4144—we should break it now.This will also simplify PR #4334 and PR #4342.