Skip to content

Allow any element to be the child of a custom element (parser weirdness permitting) #10722

Open
@LeaVerou

Description

@LeaVerou

What problem are you trying to solve?

Certain elements, such as <li> or <option> are only permitted within certain element types. Should this perhaps be expanded to custom elements? Many use cases where a custom element may reasonably want to slot these.

What solutions exist today?

Currently they need to invent their own elements (e.g. <sl-option>) that provide no functionality, and just mirror the API of these.

How would you solve it?

If there is no parser weirdness, allow any element to have a custom element as a parent. @annevk thought that sounds reasonable, with that caveat.

Anything else?

No need to do it all at once, it could be done one element at a time, starting from <li> and <option>, which are the ones I most frequently needed to slot personally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.document conformancetopic: custom elementsRelates to custom elements (as defined in DOM and HTML)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions