Skip to content

Allow a custom element to act as a form #10220

@jakearchibald

Description

@jakearchibald

What problem are you trying to solve?

I want to create a custom element, <ui-form>, which has or wraps form functionality.

What solutions exist today?

<form is="my-custom-thing">, but WebKit opposes this.

How would you solve it?

Assuming that WebKit will not change their position:

My <ui-form> could create a shadow root which contains <form><slot></slot></form>.

However, at present (although it isn't clear from the algorithm), shadow boundaries are not crossed when associating fields with forms.

Instead, the algorithm could be updated to cross-shadow boundaries. For compatibility, the form must opt-in to being considered when crossing shadow boundaries: <form allowcrossshadowboundarypleasethankyou>. There may be better names.


Or, instead of that, provide a way to allow a custom element to act like a form itself, similar to how custom elements can become form associated.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interesttopic: custom elementsRelates to custom elements (as defined in DOM and HTML)topic: formstopic: shadowRelates to shadow trees (as defined in DOM)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions