material-components / material-components/material-web

Form-associated buttons no longer submit correctly

Open
#6,030 0 comments 0 reactions 0 assignees View on GitHub

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

Lit Playground

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.