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.
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
In the example I created an element that is activated by clicking on the , which is impossible to implement with regular web components.