Skip to content

ElementInternals API support #289

Description

@Qsppl

Hi, I can't create form associated element via Hybrids.js.

Here is the description of this API in MDN: ElementInternals.

Here is an example of an element associated with a form taken from this MDN guide:

ElementInternals - form associated element

customElements.define(
  "my-form-associated-input",
  class extends HTMLElement {
    static formAssociated = true;

    constructor() {
      super();
      this._internals = this.attachInternals();
    }

    connectedCallback() {
      this.attachShadow({
        mode: "open",
        delegatesFocus: true
      }).innerHTML = `<input type="text" />`;
    }
  }
);

In the example I created an element that is activated by clicking on the , which is impossible to implement with regular web components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    propertiesApplies to the property definition

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions