Skip to content

Commit ac688c0

Browse files
scottaoharastraker
andauthored
fix(aria-allowed-role): allow combobox on button, checkbox and combobox on input[type=button] (#3354)
* Update allowed button & input type=button roles closes #3353 - Adds `role=combobox` to the `<button>` element. - Adds `role=combobox` and `role=checkbox` to the `<input type=button>` element. * fix whitespace * add pass ids * `button role=combobox` * `input type=button role=combobox` * `input type=button role=checkbox` * add tests * `button role=combobox` * `input type=button role=combobox` * `input type=button role=checkbox` Co-authored-by: Steven Lambert <steven.lambert@deque.com>
1 parent 228daf1 commit ac688c0

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

lib/standards/html-elms.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ const htmlElms = {
138138
contentTypes: ['interactive', 'phrasing', 'flow'],
139139
allowedRoles: [
140140
'checkbox',
141+
'combobox',
141142
'link',
142143
'menuitem',
143144
'menuitemcheckbox',
@@ -395,6 +396,8 @@ const htmlElms = {
395396
}
396397
},
397398
allowedRoles: [
399+
'checkbox',
400+
'combobox',
398401
'link',
399402
'menuitem',
400403
'menuitemcheckbox',

test/integration/rules/aria-allowed-role/aria-allowed-role.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,30 @@ <h1 id="pass-h1-role-doc-subtitle" role="doc-subtitle"></h1>
125125
aria-expanded="true"
126126
id="pass-input-tel-role-spinbutton"
127127
/>
128+
<input
129+
aria-autocomplete="list"
130+
value="some label"
131+
autocomplete="off"
132+
role="combobox"
133+
type="button"
134+
aria-expanded="true"
135+
id="pass-input-button-role-combobox"
136+
/>
137+
<button
138+
aria-autocomplete="list"
139+
aria-label="some label"
140+
autocomplete="off"
141+
role="combobox"
142+
type="button"
143+
aria-expanded="true"
144+
id="pass-button-role-combobox">ok</button>
145+
<input
146+
value="some label"
147+
role="checkbox"
148+
type="button"
149+
aria-checked="true"
150+
id="pass-input-button-role-checkbox"
151+
/>
128152
<input type="image" role="link" id="pass-input-image-valid-role" />
129153
<input
130154
type="checkbox"

test/integration/rules/aria-allowed-role/aria-allowed-role.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
["#pass-input-tel-role-spinbutton"],
4646
["#pass-input-image-valid-role"],
4747
["#pass-input-checkbox-valid-role"],
48+
["#pass-button-role-combobox"],
49+
["#pass-input-button-role-checkbox"],
50+
["#pass-input-button-role-combobox"],
4851
["#pass-h1-valid-role"],
4952
["#pass-img-valid-role"],
5053
["#pass-button-role-radio"],

0 commit comments

Comments
 (0)