Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with ElementInternals #1121

Closed
wants to merge 1 commit into from
Closed

Integrate with ElementInternals #1121

wants to merge 1 commit into from

Commits on Jan 16, 2024

  1. Integrate with ElementInternals

    Closes [#1023][]
    
    Replace the requirement for an `<input type="hidden">` element with
    direct `<form>` integration through built-in support for
    [ElementInternals][].
    
    According to the [Form-associated custom elements][] section of [More
    capable form controls][], various behaviors that the `<trix-editor>`
    element was recreating are provided out of the box.
    
    For example, the `<input type="hidden">`-`[input]` attribute pairing can
    be achieved through [ElementInternals.setFormValue][]. Similarly, the
    `<label>` element support can be achieved through
    [ElementInternals.labels][].
    
    [#1023]: #1023
    [ElementInternals]: https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals
    [Form-associated custom elements]: https://web.dev/articles/more-capable-form-controls#form-associated_custom_elements
    [More capable form controls]: https://web.dev/articles/more-capable-form-controls
    [ElementInternals.setFormValue]: https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue
    [ElementInternals.labels]: https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/labels
    seanpdoyle committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    8d92336 View commit details
    Browse the repository at this point in the history