diff --git a/third_party/aria-practices/src/content/patterns/listbox/examples/listbox-collapsible.html b/third_party/aria-practices/src/content/patterns/listbox/examples/listbox-collapsible.html index 8a611e99b21bf..fb3bc1c148fb6 100644 --- a/third_party/aria-practices/src/content/patterns/listbox/examples/listbox-collapsible.html +++ b/third_party/aria-practices/src/content/patterns/listbox/examples/listbox-collapsible.html @@ -2,62 +2,14 @@ - (Deprecated) Collapsible Dropdown Listbox Example - - - - - - - - - -
-

(Deprecated) Collapsible Dropdown Listbox Example

- -
-

About This Example

-
-

Deprecation Warning

-

- This pattern has been deprecated, and will be removed in a future version of the ARIA Authoring Practices. - The select-only combobox should be used as an alternative to this pattern. -

-
- -

- The following example implementation of the Listbox Pattern demonstrates a collapsible single-select listbox widget that is functionally similar to an HTML select input with the attribute size="1". - The widget consists of a button that triggers the display of a listbox. - In its default state, the widget is collapsed (the listbox is not visible) and the button label shows the currently selected option from the listbox. - When the button is activated, the listbox is displayed and the current option is focused and selected. -

-

Similar examples include:

- -
- -
-
-

Example

-
-

Choose your favorite transuranic element (actinide or transactinide).

@@ -98,238 +50,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
Tab -
    -
  • Moves focus into and out of the listbox.
  • -
  • If the listbox is expanded, selects the focused option, collapses the listbox, and moves focus out of the listbox.
  • -
-
Enter -
    -
  • If the focus is on the button, expands the listbox and places focus on the currently selected option in the list.
  • -
  • If focus is in the listbox , collapses the listbox and keeps the currently selected option as the button label.
  • -
-
EscapeIf the listbox is displayed, collapses the listbox and moves focus to the button.
Down Arrow -
    -
  • Moves focus to and selects the next option.
  • -
  • If the listbox is collapsed, also expands the list.
  • -
-
Up Arrow -
    -
  • Moves focus to and selects the previous option.
  • -
  • If the listbox is collapsed, also expands the list.
  • -
-
HomeIf the listbox is displayed, moves focus to and selects the first option.
EndIf the listbox is displayed, moves 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 listbox on this page implements 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
aria-labelledby="ID_REF1 ID_REF2"button -
    -
  • References the two elements whose labels are concatenated by the browser to label the button.
  • -
  • The first element is a span containing text Choose an element: .
  • -
  • The second element is the button itself; the button text is set to the name of the currently chosen element.
  • -
-
aria-haspopup="listbox"buttonIndicates that activating the button displays a listbox.
aria-expanded="true"button -
    -
  • Set by the JavaScript when the listbox is displayed.
  • -
  • Otherwise, is not present.
  • -
-
listboxulIdentifies the focusable element that has listbox behaviors and contains the listbox options.
aria-labelledby="ID_REF"ulRefers to the element containing the listbox label.
tabindex="-1"ul -
    -
  • Makes the listbox focusable.
  • -
  • The JavaScript sets focus on the listbox when it is displayed.
  • -
-
aria-activedescendant="ID_REF"ul -
    -
  • 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. -
  • -
-
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.
  • -
-
-
- -
-

JavaScript and CSS Source Code

- -
- -
-

HTML Source Code

-

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

- -
- - -
-