diff --git a/third_party/aria-practices/src/content/patterns/listbox/examples/listbox-grouped.html b/third_party/aria-practices/src/content/patterns/listbox/examples/listbox-grouped.html index 0fb040b0c251a..b70b2636f2bc7 100644 --- a/third_party/aria-practices/src/content/patterns/listbox/examples/listbox-grouped.html +++ b/third_party/aria-practices/src/content/patterns/listbox/examples/listbox-grouped.html @@ -2,51 +2,14 @@ - Listbox Example with Grouped Options - - - - - - - - - -
-

Listbox Example with Grouped Options

- -
-

About This Example

- -

- The following example implementation of the Listbox Pattern demonstrates a single-select listbox widget with grouped options. - This widget is functionally similar to an HTML select element with size greater than 1 and options grouped into categories with labeled optgroup elements. -

-

Similar examples include:

- -
- -
-
-

Example

-
-
@@ -112,197 +75,5 @@
- -
- - -
-

Accessibility Features

- -
- -
-

Keyboard Support

-

- The example listbox on this page implements the following keyboard interface. - Other variations and options for the keyboard interface are described in the Keyboard Interaction section of the Listbox Pattern. -

-

- NOTE: When visual focus is on an option in this listbox implementation, DOM focus remains on the listbox element and the value of aria-activedescendant on the listbox refers to the descendant option that is visually indicated as focused. - Where the following descriptions of keyboard commands mention focus, they are referring to the visual focus indicator, not DOM focus. - For more information about this focus management technique, see - Managing Focus in Composites Using aria-activedescendant. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyFunction
TabMoves focus into and out of the listbox.
Down ArrowMoves focus to and selects the next option.
Up ArrowMoves focus to and selects the previous option.
HomeMoves focus to and selects the first option.
EndMoves focus to and selects the last option.
Printable Characters -
    -
  • Type a character: focus moves to the next item with a name that starts with the typed character.
  • -
  • Type multiple characters in rapid succession: focus moves to the next item with a name that starts with the string of characters typed.
  • -
-
-
- -
-

Role, Property, State, and Tabindex Attributes

-

- The example listboxes on this page implement the following ARIA roles, states, and properties. - Information about other ways of applying ARIA roles, states, and properties is available in the Roles, States, and Properties section of the Listbox Pattern. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RoleAttributeElementUsage
listboxdivIdentifies the focusable element that has listbox behaviors and contains the listbox options.
aria-labelledby="ID_REF"divRefers to the element containing the listbox label.
tabindex="0"divIncludes the listbox in the page tab sequence.
aria-activedescendant="ID_REF"div -
    -
  • When an option in the listbox is visually indicated as having keyboard focus, refers to that option.
  • -
  • Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the listbox element.
  • -
  • When navigation keys, such as Down Arrow, are pressed, the JavaScript changes the value.
  • -
  • - For more information about this focus management technique, see - Managing Focus in Composites Using aria-activedescendant. -
  • -
-
groupulIdentifies a group of related options
aria-labelledby="ID_REF"ulRefers to the element containing the option group label.
optionliIdentifies each selectable element containing the name of an option.
aria-selected="true"li -
    -
  • Indicates that the option is selected.
  • -
  • Applied to the element with role option that is visually styled as selected.
  • -
  • The option with this attribute is always the same as the option that is referenced by aria-activedescendant because it is a single-select listbox where selection follows focus.
  • -
-
aria-hidden="true"span - Removes the character entity used for the check mark icon from the accessibility tree to prevent it from being included in the accessible name of the option. -
-
- -
-

JavaScript and CSS Source Code

- -
- -
-

HTML Source Code

-

To copy the following HTML code, please open it in CodePen.

- -
- - -
-