Skip to content

Does Trix plan to support HTMLElement.attachInternals? #1023

Closed
@seanpdoyle

Description

@seanpdoyle

Integrating with HTMLElement.attachInternals could enable <trix-editor> elements to write their contents directly to <form> and FormData instances, without the need to write to a related <input type="hidden"> element.

Furthermore, they could set their validity state with attribute validations like [required], add support for CSS pseudo-classes like :invalid and :disabled, access their assigned <form> element from callbacks.

There are fairly straightforward paths toward changing the Trix codebase to rely on mechanisms built-into ElementInternals, and some clear wins to be had.

Unfortunately (!), there isn't global support just yet, with Safari as the main hold-out. According to the WebKit Bug Tracker, there have been recent changes aimed at implementing ElementInternals.

Has there been any discussion about migrating toward using these tools? Would it be possible to start a migration with feature detection checks for partial support, or would it be best to wait until all browser support has landed before getting started?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions