-
A selectable item in a listbox.
+
An item in a listbox.
Authors MUST ensure elements with role option
are contained in, or owned by, an element with the role listbox or group within a listbox
. Options not associated with a listbox might not be correctly mapped to an accessibility API.
-
Elements with the role option
have an implicit aria-selected value of false
.
+
User agents MAY provide an implicit value of aria-selected for each option in a listbox if the following conditions are met, but user agents MUST NOT provide an implicit value of aria-selected if any of the following conditions are not met:
+
+ - The value of aria-multiselectable on the listbox is
false
or undefined
.
+ - None of the option elements in the listbox have an explicitly declared value for aria-selected or aria-checked.
+
+
+ If a user agent provides an implicit aria-selected value for an option, the value SHOULD be true
if the option has DOM focus or the [listbox] has DOM focus and the option is referenced by aria-activedescendant.
+ Otherwise, if a user agent provides an implicit aria-selected value for an option, the value SHOULD be false
.
+
+
+ The option role supports both aria-selected and aria-checked because it is common for authors to use selection in single-select list boxes and check marks in multi-select list boxes.
+ However, authors SHOULD NOT specify both aria-selected and aria-checked on option elements contained by the same listbox except in the extremely rare circumstances where all the following conditions are met:
+
+
+ - The meaning and purpose of aria-selected is different from the meaning and purpose of aria-checked in the user interface.
+ - The user interface makes the mening and purpose of each state apparent.
+ - The user interface provides a separate method for controling each state.
+