material-components / material-components/material-web

Buttons' appearance in disabled fieldset

Open
#5,562 2 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 a button or icon button is in a disabled fieldset, it correctly does not trigger `click` event. However, the appearance is not changed to match:

![image](https://github.com/material-components/material-web/assets/6388546/e786c470-1a46-4972-bbb2-d56ec14ffe28)

### Reproduction

[Lit Playground](https://lit.dev/playground/#project=W3sibmFtZSI6InNpbXBsZS1ncmVldGluZy50cyIsImNvbnRlbnQiOiJpbXBvcnQgXCJAbWF0ZXJpYWwvd2ViL2FsbFwiOyJ9LHsibmFtZSI6ImluZGV4Lmh0bWwiLCJjb250ZW50IjoiPCFET0NUWVBFIGh0bWw-XG48aGVhZD5cbiAgPGxpbmsgcmVsPVwic3R5bGVzaGVldFwiIGhyZWY9XCJodHRwczovL2ZvbnRzLmdvb2dsZWFwaXMuY29tL2NzczI_ZmFtaWx5PU1hdGVyaWFsK1N5bWJvbHMrT3V0bGluZWQ6b3Bzeix3Z2h0LEZJTEwsR1JBREAyMC4uNDgsMTAwLi43MDAsMC4uMSwtNTAuLjIwMFwiIC8-XG4gIDxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiIHNyYz1cIi4vc2ltcGxlLWdyZWV0aW5nLmpzXCI-PC9zY3JpcHQ-XG48L2hlYWQ-XG48Ym9keT4gIFxuICA8cD5cbiAgICA8bWQtZmlsbGVkLWJ1dHRvbiBjbGFzcz1cImJ0blwiPlxuICAgICAgSGVsbG9cbiAgICA8L21kLWZpbGxlZC1idXR0b24-XG4gICAgPG1kLW91dGxpbmVkLWljb24tYnV0dG9uIGNsYXNzPVwiYnRuXCI-XG4gICAgICA8bWQtaWNvbj5hZGQ8L21kLWljb24-XG4gICAgPC9tZC1vdXRsaW5lZC1pY29uLWJ1dHRvbj5cbiAgPC9wPlxuICBcbiAgPHA-XG4gICAgPG1kLWZ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HJ1ZX1d)

### Workaround

We have to manually keep track of the buttons' state and disable/enable each of them.

### Is this a regression?

No or unsure. This never worked, or I haven't tried before.

### Affected versions

1.4.0

### Browser/OS/Node environment

Browser: Google Chrome Version 123.0.6312.86 (Official Build) (64-bit)

OS: Windows 11

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 Lit Playground reproduction in the issue, focusing on md-filled-button and md-outlined-icon-button inside the disabled fieldset. Trace the components' disabled styling and verify that buttons and icon buttons in a disabled fieldset receive the same appearance as individually disabled controls.

Written by the indexing model from the issue text.

Assessment

Tech stack
scss
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.