Tree does not follow the expected ARIA structure #21143
Labels
Accessibility
This issue is related to accessibility (a11y)
area: cdk/tree
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Reference https://www.w3.org/TR/wai-aria-practices-1.1/#tree_roles_states_props
First of all, our entire concept of a flat tree isn't super compatible with the expected ARIA structure for trees. Each
treeitem
element is supposed to either contain oraria-own
arole="group"
element that contains all of its child nodes. To keep the notion of the flat-tree alive, we've have to usearia-owns
in a way that looks something like this:Which means that it would be the responsibility of the tree to figure out where to insert these
role="group"
elements, which I'm not totally sure is possible.The nested tree is easier to reconcile, since we actually do nest the nodes; the main problem is that we're missing the
role="group"
element for nodes that have children. The desired structure would look something likeThe text was updated successfully, but these errors were encountered: