YUI recommends YUI3.
YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.
This documentation is no longer maintained.
This AutoComplete example demonstrates how to make the widget more screenreader accessible.
Implementers who are working with data from third-party sources, user input data, or otherwise untrustworthy sources should be sure to read the Security Considerations section of the AutoComplete user guide.
There are a few simple things you should do to make your AutoComplete implementation more screenreader accessible.
First, provide a label element for your input field. Within this label, you can include a span that is styled via CSS to be displayed offscreen with helpful text that screenreaders will read aloud.
If you insert the span element that holds the screenreader text into the label dynamically at runtime, most screenreaders will read it aloud each time only when the user focuses on the input for a new AutoComplete interaction, instead of during regular page browsing.
typeAhead
featureBy setting your AutoComplete's typeAhead
property to true, screenreaders (in focus mode) will read aloud each suggestion as the user navigates them with the up and down arrow keys.
autoHighlight
featureBy default, AutoComplete's autoHighlight
property is enabled, which may add confusion when screenreaders read aloud the first suggestion when it is autohighlighted. To avoid this scenario, disable the autoHighlight
feature.
Markup:
JavaScript:
Note: Logging and debugging is currently turned off for this example.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.
Copyright © 2013 Yahoo! Inc. All rights reserved.