material icon indicating copy to clipboard operation
material copied to clipboard

autocomplete: use <md-not-found> message instead of hardcoded message for ARIA

Open mkowalchuk opened this issue 7 years ago • 2 comments

Bug

Detailed Reproduction Steps:

  1. Set up an md-autocomplete, and provide a distinct "not found" message using md-not-found.
  2. Turn on a screen reader
  3. Enter some text into the autocompleter that results in the "not found" message being shown.

What is the expected behavior?

The screen reader should announce the contents of the md-not-found element.

What is the current behavior?

The screen reader announces "There are no matches available"

What is the use-case or motivation for changing an existing behavior?

Users of screen readers should hear the same message that's shown on the screen.

Which versions of AngularJS, Material, OS, and browsers are affected?

  • AngularJS: 1.6
  • AngularJS Material: 1.1.19
  • OS: ChromeOS
  • Browsers: Chrome
  • Screen reader: ChromeVox

Is there anything else we should know? Stack Traces, Screenshots, etc.

Relevant code: https://github.com/angular/material/blob/master/src/components/autocomplete/js/autocompleteController.js (getCountMessage)

mkowalchuk avatar Sep 04 '19 22:09 mkowalchuk

Agreed. Plus the whole getCountMessage() function should be made localizable (i.e. it should not be hard coded to English strings).

https://github.com/angular/material/blob/20c4d3fbb9c92dd6c182bee12ad40d3b707935fa/src/components/autocomplete/js/autocompleteController.js#L1012-L1024

Splaktar avatar Sep 05 '19 16:09 Splaktar

Posted PR https://github.com/angular/material/pull/12059 to allow defining all of these messages, whether for localization or otherwise.

Splaktar avatar Dec 15 '20 03:12 Splaktar