Multiselect Listbox Example

About This Example

This example demonstrates a multiselect listbox widget following the Listbox Pattern with the aria-multiselectable property. This widget allows the selection of one or more options from a list and is functionally similar to an HTML select element with the multiple attribute.

Example

  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5

(Note: Checkmark icons, etc., may also be used to visually indicate selected options.)

Keyboard Interaction

Roles, States, and Properties

Note

The Listbox Pattern recommends using aria-checked for multiselect listboxes and recommends against using both aria-checked and aria-selected. However, this is not supported by current, leading screen readers, JAWS 2024 and NVDA 2024:

  • Both screen readers say "not selected" if aria-selected is undefined, so options with only aria-checked="true" are indciated as "checked, not selected", which is incorrect.
  • Neither screen reader says "selected" if aria-selected="true", making it difficult to identify selected options if only aria-selected is used. (This behavior is designed for single-select listboxes where selection follows focus and "selected" is implied.)

Until leading screen readers change the above behaviors, the only effective solution appears to be to use both aria-checked and aria-selected.

Reference Example

For comparison, the following example is an HTML Select with the multiple attribute. In most desktop browsers, users must hold the Ctrl key to move between or make multiple selections, which is confusing and error-prone. As with aria-selected, leading screen readers do not explicitly say which options are selected.