Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
1 task
emipre opened this issue Dec 16, 2024 · 1 comment
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

Comments

@emipre
Copy link

emipre commented Dec 16, 2024

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
@emipre emipre added the needs triage This issue needs to be triaged by the team label Dec 16, 2024
@amysorto amysorto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent Accessibility This issue is related to accessibility (a11y) area: material/datepicker and removed needs triage This issue needs to be triaged by the team labels Dec 16, 2024
@Sepandard
Copy link
Contributor

Just wanted to chime in, I started working on this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants