Skip to content

Datepicker mat-icon-button: Ability to provide unique accessible names for calendar icons #20590

Closed
@ramjiseetharaman

Description

@ramjiseetharaman

Reproduction:

You can find this issue in the Angular Material documentation in the following link. For some of the examples such as "Comparison Ranges", " Setting the selected date", " Changing the datepicker colors" etc, there are multiple datepickers used. The programmatic label for calendar icon is not unique to Screen readers, since the aria-label is the same for all.

https://material.angular.io/components/datepicker/

Steps to reproduce:

  1. Navigate to the Date picker documentation: https://material.angular.io/components/datepicker/
  2. Navigate to one of the sections that has multiple date picker fields mentioned above.
  3. Run JAWS/VoiceOver/NVDA (any screen reader can be used)
  4. Verify whether the calendar icon communicates unique accessible names or provide a way to update it (Issue)

Expected Behavior

There needs to be a way to provide unique labels for the calendar icons, if there are more than one date picker fields used in the page. The aria-label for the calendar icon has a value of "Open calendar". There needs to be an alternate way for Screen readers users to differentiate the calendar icon associations to the input field. Using the component as is in the application, there is no means to update the aria-label for the calendar icons.

Angular Material - Date Picker - Labels not unique for calendar icons

Actual Behavior

If there are multiple date picker fields, Screen readers will render the same redundant labels making it difficult for Screen readers to differentiate. This is because the aria-label for all the calendar icons are the same.

Environment

  • Angular: 10.2.1
  • CDK/Material: 10.2.1
  • Browser(s): Chrome
  • Operating System: Windows/Mac

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsarea: material/datepickerfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions