Chrome complaining about "illegal use of labels"
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
### Description
When using `` with `` and `` Chrome prints out the following warning:
**`Incorrect use of `**
I assume this is a new check Chrome added in a recent versions to it's dev tools. Though I guess Angular Material should probably comply to those, if at all possible.
### Reproduction
This can be easily reproduced, even on the Angular Material Page, e.g. on https://material.angular.io/components/form-field/overview (though it appears on any page that uses `` and `` within ``

### Expected Behavior
No error should be displayed
### Actual Behavior
**Incorrect use of ``** is printed for each mat-label within a mat-form-field
### Environment
- Angular: 17.0.1
- CDK/Material: 17.0.1
- Browser(s): Chrome 117
- Operating System: Windows
Contributor guide
Research direction
Start by reproducing the warning on the Angular Material form-field overview page with mat-form-field, mat-select, and mat-label, then trace how those components render their label association. Done means Chrome no longer reports incorrect use of the label for attribute in this scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100