- From: Caleb Williams <notifications@github.com>
- Date: Sat, 25 Feb 2023 07:39:07 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Saturday, 25 February 2023 15:39:20 UTC
I could be wrong but since the default submit button for a form is typically the first in source order wouldn’t it make more sense to have an API on either `HTMLFormElement.prototype` or on internals that could be called whenever an element becomes associated with a form
```javascript
class CustomSubmitButton extends HTMLElement {
static formAssociated = true;
#internals = this.attachInternals();
formAssociatedCallback(form) {
this.#internals.registerSubmitButtonFor(form);
}
}
```
--
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/814#issuecomment-1445144352
You are receiving this because you are subscribed to this thread.
Message ID: <WICG/webcomponents/issues/814/1445144352@github.com>
Received on Saturday, 25 February 2023 15:39:20 UTC