aria-practices
aria-practices copied to clipboard
How can I distinguish between operable and non-operable elements in the tree?
A treeitem always has two functions:
- I can show and hide subordinate elements (with the arrow keys)
- I can sometimes select or activate the treeitem (with Enter or Space)
How can I mark treeitems that do not have the second function? In the APG example the parent list items might not be linked. I can show this visually, but how do I communicate this programmatically? Certainly not with aria-disabled, because then the first function is also transmitted as deactivated.
The same applies to the entire tree
- I can simply use the tree to display nested information,
- the tree can also be a control element for selection or navigation.
Even at tree level, a programmatic distinction between a pure display element and a control element would make sense. Just as there is a distinction between selection lists (role=listbox) and lists (role=list) or between tables (role=table) and grids (role=grid).
The ARIA specification restricts the use of a tree to the selection of elements: "A widget that allows the user to select one or more items from a hierarchically organized collection." If this is the case, then the APG Navigation Treeview Example would not be permitted because it is not used for selection but for navigation. If a tree is really only used for selection, then my second question would be superfluous, but the first question still remains: How do I mark treeitems that I cannot select because they only serve to show and hide? Or can I only use trees if they are used for selection and I can also select each entry? But that would limit the applicability very much and then there would be a great need for an element with which I can also navigate or simply display nested content efficiently.