bug(matTooltip): Add option to set aria-labelledby rather than aria-describedby
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
#### 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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par localiser l’implémentation de matTooltip et son comportement d’accessibilité existant. Vérifiez comment aria-describedby est appliqué aux hosts, puis définissez la configuration aria-labelledby prise en charge et vérifiez que l’étiquetage des tooltips fonctionne pour les boutons sans libellé sans régression du comportement de description.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- accessibility, frontend
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100