angular / angular/components

Chrome complaining about "illegal use of labels"

オープン
#28,184 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
area: material/select P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### 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 ``

![image](https://github.com/angular/components/assets/36888285/0d444ad5-98a6-470f-99d8-b2d0e6a31c3a)

### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、mat-form-field、mat-select、mat-label を使用して Angular Material の form-field 概要ページに表示される警告を再現し、次にそれらのコンポーネントがラベルとの関連付けをどのようにレンダリングしているかを追跡します。このシナリオで、Chrome が label の for 属性の誤った使用を報告しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
accessibility, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。