material-components / material-components/material-web
Form-associated buttons no longer submit correctly
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
Description
When there are multiple buttons in a form, only the clicked button should submit its name/value.
However, now all Material buttons in a form submit their name/value. In fact, even Material buttons that aren't submit buttons will submit their name/value.
I suspect this regression may have been caused by 082faad915fb4ded0c151ca6546027fa7f37c616
Reproduction
Workaround
I have not found a workaround.
Is this a regression?
Yes. This used to work, but now it doesn't.
Affected versions
Failing in 2.5.0, worked in 2.4.1
Browser/OS/Node environment
Browser: Chrome 151.0.7922.138
OS: Windows 11
Node version: 24.19.0
npm version: 12.0.2
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 Lit Playground reproduction and compare button behavior between versions 2.4.1 and 2.5.0. Inspect the suspected commit 082faad915fb4ded0c151ca6546027fa7f37c616 and the Material button component behavior it changed. Done means only the clicked submit button contributes its name/value, while non-submit buttons contribute neither.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100