Skip to content

Commit f482257

Browse files
carmacleodmcking65
andauthored
Select-only Combobox Example: Add Accessibility Features section (pull #1432)
Co-authored-by: Matt King <[email protected]>
1 parent c9524a5 commit f482257

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/combobox/combobox-select-only.html

+17
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,23 @@ <h2 id="ex_label">Example</h2>
6767
<div role="separator" id="ex_end_sep" aria-labelledby="ex_end_sep ex_label" aria-label="End of"></div>
6868
</section>
6969

70+
<section>
71+
<h2>Accessibility Features</h2>
72+
<p>While the functionality and user experience of this example are nearly equivalent to an HTML <code>select</code> element with the attribute <code>size="1"</code>, the following differences in behavior are implemented to improve both accessibility and general usability.</p>
73+
<ol>
74+
<li>
75+
If the combobox is collapsed and the user types printable characters, the listbox is displayed and receives accessibility focus via <code>aria-activedescendant</code>.
76+
This enables users to perceive the presence of the options, and enables assistive technology users to comprehend the size of the list of options.
77+
</li>
78+
<li>
79+
Navigating the list of options does not set the value of the input.
80+
This gives screen reader users, who need to navigate among the options to perceive them, the ability to explore options without losing the current value of the input.
81+
The value is set when users press <kbd>Space</kbd>, <kbd>Enter</kbd>, or <kbd>Tab</kbd>, or when focus moves out of the combobox.
82+
The current value is retained if the listbox is closed with <kbd>Escape</kbd> or if the user collapses the list by clicking the input.
83+
</li>
84+
</ol>
85+
</section>
86+
7087
<section>
7188
<h2 id="kbd_label">Keyboard Support</h2>
7289
<p>

0 commit comments

Comments
 (0)