material-components / material-components/material-web
sveltejs/kit@2.43.3 throws on formSubmit
Nobody has claimed this yet.
- Dominant language
- SCSS
- Stars
- 11.3k
- Forks
- 1.1k
- Avg merge
- 20h 28m
- Merged PRs (30d)
- 13
Description
What is affected?
Component, Accessibility
Description
The following svelte/kit code
<form method="get" action="/api">
<md-filled-button type="submit">Submit</md-filled-button>
</form>
throws an error: Uncaught TypeError: Failed to construct 'FormData': The specified element is not a submit button.
This diff is "responsible", the issue is that the controller/formSubmitter adds the md-button as the submitter
Reproduction
<form method="get" action="/api">
<md-filled-button type="submit">Submit</md-filled-button>
</form>
Workaround
<md-filled-button type="submit" onclick="{(e) => { e.preventDefault(); e.target.form.requestSubmit(); }}">Submit</md-filled-button>
Is this a regression?
No or unsure. This never worked, or I haven't tried before.
Affected versions
2.4.0
Browser/OS/Node environment
Browser: Firefox/143.0
Os: Widows 11
Node version: v22.13.1
Npm version: 10.9.2
should be a general issue on every Browser/version
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction and inspect internal/controller/form-submitter.ts, especially the controller behavior identified in the report. Compare the SvelteKit formSubmit behavior with the md-filled-button submitter interaction. Done means the provided form can submit without the reported FormData TypeError in the affected browser scenarios.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100