Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Autocomplete accessibility: limit number of matches and highlighted items announced #2785

@marcysutton

Description

@marcysutton

Upon re-testing the autocomplete component, something happened to the messages array sent to our <aria-status> child directive causing all of the text to be appended and never removed. Inside of that component is an ng-repeat checking for messages:

<aria-status>
    <p ng-repeat="message in $mdAutocompleteCtrl.messages">{{message.display}}</p>\
</aria-status>

The messages array in autocompleteController.js now keeps appending messages without clearing upon change. Right now on focus the input reads "There are 50 matches available. There are 50 matches available." When you start typing and the list filters, it reads "There are 4 matches available. There are 2 matches available." in the same letter. States are also repeated as you arrow through the list.

It should read the "There are X matches available" when there is a change in the count, and only once for that count until another filter happens. The highlighted state only should read aloud as you arrow through the list (not a notice about matches available).

We also need to announce when there are no matches available.

See what happens in Voiceover in Safari (the same happens in Chrome):

Active autocomplete with Voiceover output

Metadata

Metadata

Labels

a11yThis issue is related to accessibility

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions