v149 · Web Components · Forms
Keyboard Activation
A native <button type="submit"> submits its form when focused and the user presses Enter or Space. Without HTMLSubmitButtonBehavior, a custom element must wire this up manually. With the behavior, the platform handles it — tab to the button, press Enter, and the form submits identically to the native case.
Tab into each form, type a name, then use Tab to reach the submit button and press Enter or Space.
Native <button type="submit">
Custom element + HTMLSubmitButtonBehavior
0native submits
0behavior submits
0Enter key events
0Space key events
Interaction log
// Tab to a button and press Enter or Space…
see also
- Form Lifecycle Demo — connect/disconnect from form
- Fancy Submit — custom element that submits on click
- Validation Relay — constraint validation with custom element
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗