autocomplete: use <md-not-found> message instead of hardcoded message for ARIA
Bug
Detailed Reproduction Steps:
- Set up an md-autocomplete, and provide a distinct "not found" message using md-not-found.
- Turn on a screen reader
- 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)
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
Posted PR https://github.com/angular/material/pull/12059 to allow defining all of these messages, whether for localization or otherwise.