bug(mat-calendar): The calendar contains toggle buttons that do not behave like toggle buttons (Accessibility) #30190
Labels
Accessibility
This issue is related to accessibility (a11y)
area: material/datepicker
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
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:
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
The text was updated successfully, but these errors were encountered: