angular / angular/components

bug(mat-calendar): The calendar contains toggle buttons that do not behave like toggle buttons (Accessibility)

Ouverte
#30,190 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Accessibility area: material/datepicker P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
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 mat-calendar component contains a button for each selectable date. When navigating the calendar using a screen reader, each button will be read as "toggle button" indicating that the buttons state should change each time the button is pressed. However the button does not behave like a toggle button. Once the button is toggled it cannot be "untoggled", potentially causing confusion for the user. I believe the `aria-pressed` attribute on the button should be removed to correctly reflect the buttons behaviour.

This was discovered during a recent accessibility evaluation and they provided the following link: https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html

### Reproduction

Example link: https://material.angular.io/components/datepicker/overview#datepicker-inline-calendar

Steps to reproduce:
1. Use the example link in the browser (I used Chrome)
2. Start the screen reader (I used VoiceOver on MacOS)
3. Navigate to the calendar dates an hear them being read as "toggle button"
4. Realize that you cannot change the pressed state of the toggle button by pressing it multiple times

### Expected Behavior

That the button isn't announced as a toggle button when it doesn't behave like a toggle button.

### Actual Behavior

The button is announced as a toggle button even though it doesn't behave like one.

### Environment

- Angular: 19.0.4
- CDK/Material: 19.0.3
- Browser(s): Chrome (similar result expected in other browsers)
- Operating System: macOS

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par les boutons de date de mat-calendar affichés dans l’exemple de inline-calendar de datepicker et repérez où leur attribut aria-pressed est appliqué. Vérifiez le comportement avec un lecteur d’écran après la modification ; c’est terminé lorsque les dates sélectionnables ne sont plus annoncées comme des boutons bascule, tout en conservant leur comportement de calendrier.

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é
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.