angular / angular/components

bug(mat-checkbox): Wrong appearance when inside a disabled fieldset

Open
#27,223 3 comments 0 reactions 0 assignees View on GitHub
area: material/checkbox P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

The material checkbox is not styled correctly when inside a disabled [fieldset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset).

The appearance should be the same as when outside a fieldset:
![image](https://github.com/angular/components/assets/24881789/3e6f44db-799b-42e0-835f-f5c788b3b9fa)

### Reproduction

StackBlitz link:
Steps to reproduce:
1. https://stackblitz.com/edit/components-issue-penyki

### Expected Behavior

1. When checked, a grey background within the tick box
2. The font color is light gray
3. Not clickable (disabled)

### Actual Behavior

1. When checked, no background within the tick box
2. The font color is black
3. Clickable. Possible to change checked state.

### Environment

- Angular: 16.0.0
- CDK/Material: 16.0.3
- Browser(s): Chrome, Firefox, Edge
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and compare the checkbox behavior inside and outside a disabled fieldset in Chrome, Firefox, and Edge. Done means the checked box has a grey background, the text is light gray, and the checkbox cannot change state when its fieldset is disabled.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.