-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should aria-selected be listed as required for option role? #700
Comments
This is a good question. Section 5.2.2 Required States and Properties says:
And, it also says:
Interesting that native attributes meet the requirement but the implied semantics associated with an ARIA role do not. We have this same type of requirement on other roles, aria-checked for example. I think we should leave the role definitions the same but change the authoring requirement in section 5.2.2. Instead it should say:
|
I have changed my view on how to fix this. I now think that we need to change aria-selected to a supported property for option. There are two reasons. First, aria-selected includes language that saves authors from having to declare aria-selected=false on selectable elements in single-select widgets. The following from the aria-selected spec is baked into user agents:
Second, both option and treeitem also support aria-checked. I don't know why option supports aria-checked, but at least for treeitem, aria-checked can be used instead of aria-selected in multi-select trees. Then, it is possible to set aria-checked to mixed on a parent treeitem where some but not all descendant treeitem elements are selected (checked). So, aria-selected should be supported, not required on option. Further, aria-selected should not have an implied default value if not set. This is particularly important if aria-checked is being used instead of aria-selected. |
…ve implicit value For issue #700, made the following changes to the option role section in index.html: 1. Remove sentence from description that states there is an default value of false fore aria-selected on option elements. 2. Remove aria-selected from required states and properties row of attributes table. 3. Add aria-selected to supported row of attributes table. 4. Remove default value for aria-selected from implicit values row of attributes table. Note: This cascades to treeitem so that aria-selected is not required on treeitem.
Removes "selectable" from the definition of option to support cases where either an item is checkable instead of selectable or an item is neither selectable nor checkable (i.e., similar to disabled). The definition of option is then: >An item in a listbox. Replaces the statement: >Elements with the role option have an implicit aria-selected value of false. with a list of conditions that must be met before a user agent can provide an implicit value for aria-selected. This enables authors to: 1. Use aria-checked instead of aria-selected in any listbox. 2. Indicate that an option is not selectable or checkable by omitting the declaration of checked or selected in a listbox where either checked or selected is explicitly declared on some of the options. Adds authoring guidance that: 1. Weakly suggests use of checked instead of selected in multi-selects. 2. Strongly discourages use of both checked and selected in the same listbox. In the characteristics table for option: 1. Removes aria-selected from required properties and adds to supported properties. 2. Removes the implicit value for aria-selected.
Removes "selectable" from the definition of option to support cases where either an item is checkable instead of selectable or an item is neither selectable nor checkable (i.e., similar to disabled). The definition of option is then: >An item in a listbox. Replaces the statement: >Elements with the role option have an implicit aria-selected value of false. with a list of conditions that must be met before a user agent can provide an implicit value for aria-selected. This enables authors to: 1. Use aria-checked instead of aria-selected in any listbox. 2. Indicate that an option is not selectable or checkable by omitting the declaration of checked or selected in a listbox where either checked or selected is explicitly declared on some of the options. Adds authoring guidance that: 1. Weakly suggests use of checked instead of selected in multi-selects. 2. Strongly discourages use of both checked and selected in the same listbox. In the characteristics table for option: 1. Removes aria-selected from required properties and adds to supported properties. 2. Removes the implicit value for aria-selected.
Removes "selectable" from the definition of option to support cases where either an item is checkable instead of selectable or an item is neither selectable nor checkable (i.e., similar to disabled). The definition of option is then: >An item in a listbox. Replaces the statement: >Elements with the role option have an implicit aria-selected value of false. with a list of conditions that must be met before a user agent can provide an implicit value for aria-selected. This enables authors to: 1. Use aria-checked instead of aria-selected in any listbox. 2. Indicate that an option is not selectable or checkable by omitting the declaration of checked or selected in a listbox where either checked or selected is explicitly declared on some of the options. Adds authoring guidance that: 1. Weakly suggests use of checked instead of selected in multi-selects. 2. Strongly discourages use of both checked and selected in the same listbox. In the characteristics table for option: 1. Removes aria-selected from required properties and adds to supported properties. 2. Removes the implicit value for aria-selected.
* Resolves #700 and resolves #1052 with the following changes. Removes "selectable" from the definition of option to support cases where either an item is checkable instead of selectable or an item is neither selectable nor checkable (i.e., similar to disabled). The definition of option is then: >An item in a listbox. Replaces the statement: >Elements with the role option have an implicit aria-selected value of false. with a list of conditions that must be met before a user agent can provide an implicit value for aria-selected. This enables authors to: 1. Use aria-checked instead of aria-selected in any listbox. 2. Indicate that an option is not selectable or checkable by omitting the declaration of checked or selected in a listbox where either checked or selected is explicitly declared on some of the options. Adds authoring guidance that: 1. Weakly suggests use of checked instead of selected in multi-selects. 2. Strongly discourages use of both checked and selected in the same listbox. In the characteristics table for option: 1. Removes aria-selected from required properties and adds to supported properties. 2. Removes the implicit value for aria-selected. Co-authored-by: Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> Co-authored-by: James Teh <jamie@jantrid.net> * Duplicate option revisions in treeitem
Originally posted by @kbae00 in w3c/aria-practices#594.
Currently aria-selected is listed in the Characteristics table as a required attribute for the option role: https://www.w3.org/TR/wai-aria-1.1/#option. But the description says "Elements with the role option have an implicit aria-selected value of false." Should aria-selected be listed as a supported attribute instead of required?
The text was updated successfully, but these errors were encountered: