Editable Combobox with Grid Popup: An editable combobox that presents suggestions in a grid, enabling users to navigate descriptive information about each suggestion.
Editable Combobox with Grid Popup: An editable combobox that presents suggestions in a grid, enabling users to navigate descriptive information about each suggestion.
Editable Combobox with Grid Popup: An editable combobox that presents suggestions in a grid, enabling users to navigate descriptive information about each suggestion.
+ The following example implementation of the ARIA design pattern for combobox
+ demonstrates a single-select combobox widget that is functionally similar to an HTML select element.
+ Unlike the editable combobox examples, this select-only combobox is not made with an <input> element, and it does not accept freeform user input.
+ However, like an HTML <select>, users can type characters to select matching options.
+
Editable Combobox with Grid Popup: An editable combobox that presents suggestions in a grid, enabling users to navigate descriptive information about each suggestion.
Opens the listbox if it is not already displayed without moving focus or changing selection.
+
DOM focus remains on the combobox.
+
+
+
+
+
Alt + Down Arrow
+
+ Opens the listbox without moving focus or changing selection.
+
+
+
+
Up Arrow
+
+
+
First opens the listbox if it is not already displayed and then moves visual focus to the first option.
+
DOM focus remains on the combobox.
+
+
+
+
+
Enter
+
+ Opens the listbox without moving focus or changing selection.
+
+
+
+
Space
+
+ Opens the listbox without moving focus or changing selection.
+
+
+
+
Home
+
+ Opens the listbox and moves visual focus to the first option.
+
+
+
+
End
+
+ Opens the listbox and moves visual focus to the last option.
+
+
+
+
Printable Characters
+
+
+
First opens the listbox if it is not already displayed and then moves visual focus to the first option that matches the typed character.
+
If multiple keys are typed in quick succession, visual focus moves to the first option that matches the full string.
+
If the same character is typed in succession, visual focus cycles among the options starting with that character
+
+
+
+
+
+
Listbox Popup
+
+ NOTE: When visual focus is in the listbox, DOM focus remains on the combobox and the value of aria-activedescendant on the combobox is set to a value that refers to the listbox option that is visually indicated as focused.
+ Where the following descriptions of keyboard commands mention focus, they are referring to the visual focus indicator.
+ For more information about this focus management technique, see
+ Using aria-activedescendant to Manage Focus.
+
+
+
+
+
Key
+
Function
+
+
+
+
+
Enter
+
+
+
Sets the value to the content of the focused option in the listbox.
+
Closes the listbox.
+
Sets visual focus on the combobox.
+
+
+
+
+
Space
+
+
+
Sets the value to the content of the focused option in the listbox.
+
Closes the listbox.
+
Sets visual focus on the combobox.
+
+
+
+
+
Tab
+
+
+
Sets the value to the content of the focused option in the listbox.
+
Closes the listbox.
+
Performs the default action, moving focus to the next focusable element.
+ Note: the native <select> element closes the listbox but does not move focus on tab.
+ This pattern matches the behavior of the other comboboxes rather than the native element in this case.
+
+
+
+
+
Escape
+
+
+
Closes the listbox.
+
Sets visual focus on the combobox.
+
+
+
+
+
Down Arrow
+
+
+
Moves visual focus to the next option.
+
If visual focus is on the last option, visual focus does not move.
+
+
+
+
+
Up Arrow
+
+
+
Moves visual focus to the previous option.
+
If visual focus is on the first option, visual focus does not move.
+
+
+
+
+
Alt + Up Arrow
+
+
+
Sets the value to the content of the focused option in the listbox.
+
Closes the listbox.
+
Sets visual focus on the combobox.
+
+
+
+
+
Home
+
Moves visual focus to the first option.
+
+
+
End
+
Moves visual focus to the last option.
+
+
+
PageUp
+
Jumps visual focus up 10 options (or to first option).
+
+
+
PageDown
+
Jumps visual focus down 10 options (or to last option).
+
+
+
Printable Characters
+
+
+
First opens the listbox if it is not already displayed and then moves visual focus to the first option that matches the typed character.
+
If multiple keys are typed in quick succession, visual focus moves to the first option that matches the full string.
+
If the same character is typed in succession, visual focus cycles among the options starting with that character
diff --git a/examples/js/app.js b/examples/js/app.js
index 7d0a0f48d6..3ef86e6cd3 100644
--- a/examples/js/app.js
+++ b/examples/js/app.js
@@ -2,4 +2,60 @@
(function () {
// Load syntax highlighting
hljs.initHighlightingOnLoad();
+
+ // Add support notice to all examples
+ window.addEventListener('DOMContentLoaded', addSupportNotice, false);
+
+ function addSupportNotice() {
+ // The "Example" heading
+ var headings = document.querySelectorAll('h2');
+ var foundExampleHeading;
+ for (var i = 0; i < headings.length; ++i) {
+ if (headings[i].textContent.trim().match(/^Examples?$/)) {
+ foundExampleHeading = true;
+ break;
+ }
+ }
+ if (!foundExampleHeading) {
+ return;
+ }
+
+ // The #browser_and_AT_support link
+ var supportLink = document.querySelector('a[href$="#browser_and_AT_support"]');
+ if (!supportLink) {
+ return;
+ }
+
+ // Get the right relative URL to the root aria-practices page
+ var urlPrefix = supportLink.getAttribute('href').split('#')[0];
+
+ // Expected outcome '../js/app.js' OR '../../js/app.js'
+ var scriptSource = document.querySelector('[src$="app.js"]').getAttribute('src');
+ // Replace 'app.js' part with 'notice.html'
+
+ var fetchSource = scriptSource.replace('app.js', './notice.html');
+ //fetch('https://raw.githack.com/w3c/aria-practices/1228-support-notice/examples/js/notice.html')
+ fetch(fetchSource)
+ .then(function(response) {
+ // Return notice.html as text
+ return response.text();
+ })
+ .then(function(html) {
+ // Parse response as text/html
+ var parser = new DOMParser();
+ return parser.parseFromString(html, "text/html");
+ })
+ .then(function(doc) {
+ // Get the details element from the parsed response
+ var noticeElement = doc.querySelector('details');
+ // Rewrite links with the right urlPrefix
+ var links = doc.querySelectorAll('a[href^="/#"]');
+ for (var i = 0; i < links.length; ++i) {
+ links[i].pathname = urlPrefix;
+ }
+ // Insert the support notice before the page's h1
+ var heading = document.querySelector('h1');
+ heading.parentNode.insertBefore(noticeElement, heading.nextSibling);
+ })
+ }
}());
diff --git a/examples/js/notice.html b/examples/js/notice.html
new file mode 100644
index 0000000000..e8c1e36dc7
--- /dev/null
+++ b/examples/js/notice.html
@@ -0,0 +1,28 @@
+
+
+
+support notice (template)
+
+ Important Note About Use of This Example
+
+ Note: This is an illustrative example of one way of using ARIA that conforms with the ARIA specification.
+