bug(matTooltip): Add option to set aria-labelledby rather than aria-describedby
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
#### Reproduction
matTooltip is only able to apply aria-describedby to its host element. This is not optimal for host elements that have no aria-label or text contents.
#### Expected Behavior
What behavior were you expecting to see?
For a button with no textual label, eg a MatIconButton, a tooltip typically provides a label rather than a description.
Having matTooltip apply aria-labeledby rather than would be better in these cases.
At the very least, it would be good to have an Input to configure matTooltip's labeledby vs describedby preference.
Extra credit: change the default for obvious cases like MatIconButton.
#### Actual Behavior
What behavior did you actually see?
matTooltip applies aria-describedby, with no option to change this behavior.
#### Environment
- Angular: 12
- CDK/Material: 12
- Browser(s): any
- Operating System (e.g. Windows, macOS, Ubuntu): any
コントリビューションガイド
調査の方向性
まず、matTooltip の実装と既存のアクセシビリティ動作を見つけます。ホストに aria-describedby をどのように適用しているかを確認し、次にサポートする aria-labelledby 設定を定義して、ラベルのないボタンで tooltip のラベリングが機能し、説明の動作が後退しないことを検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- accessibility, frontend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100