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

Commit 135cf64

Browse files
tiranaThomasBurleson
authored andcommitted
Autocomplete should use role=combobox
Typically editable combo boxes are used for autocomplete behavior, and authors SHOULD set aria-autocomplete attribute on the textfield. https://www.w3.org/TR/wai-aria/roles#combobox Closes #7941
1 parent c94f08d commit 135cf64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/autocomplete/js/autocompleteDirective.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ function MdAutocomplete () {
174174
return '\
175175
<md-autocomplete-wrap\
176176
layout="row"\
177-
ng-class="{ \'md-whiteframe-z1\': !floatingLabel, \'md-menu-showing\': !$mdAutocompleteCtrl.hidden }"\
178-
role="listbox">\
177+
ng-class="{ \'md-whiteframe-z1\': !floatingLabel, \'md-menu-showing\': !$mdAutocompleteCtrl.hidden }">\
179178
' + getInputElement() + '\
180179
<md-progress-linear\
181180
class="' + (attr.mdFloatingLabel ? 'md-inline' : '') + '"\
@@ -251,6 +250,7 @@ function MdAutocomplete () {
251250
' + (attr.mdSelectOnFocus != null ? 'md-select-on-focus=""' : '') + '\
252251
aria-label="{{floatingLabel}}"\
253252
aria-autocomplete="list"\
253+
role="combobox"\
254254
aria-haspopup="true"\
255255
aria-activedescendant=""\
256256
aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"/>\
@@ -276,6 +276,7 @@ function MdAutocomplete () {
276276
' + (attr.mdSelectOnFocus != null ? 'md-select-on-focus=""' : '') + '\
277277
aria-label="{{placeholder}}"\
278278
aria-autocomplete="list"\
279+
role="combobox"\
279280
aria-haspopup="true"\
280281
aria-activedescendant=""\
281282
aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"/>\

0 commit comments

Comments
 (0)