Skip to content
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

Tree does not follow the expected ARIA structure #21143

Closed
jelbourn opened this issue Nov 25, 2020 · 1 comment · Fixed by #29096 or #29273
Closed

Tree does not follow the expected ARIA structure #21143

jelbourn opened this issue Nov 25, 2020 · 1 comment · Fixed by #29096 or #29273
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

Comments

@jelbourn
Copy link
Member

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 or aria-own a role="group" element that contains all of its child nodes. To keep the notion of the flat-tree alive, we've have to use aria-owns in a way that looks something like this:

<div role="tree">
  <div role="treeitem" aria-owns="greek-children">Greek</div>
  <div role="group" id="greek-children">
    <div role="treeitem">Alpha</div>
    <div role="treeitem">Beta</div>
    <div role="treeitem">Gamma</div>
  </div>
</div>

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 like

<div role="tree">
  <div role="treeitem">
    Greek
    <div role="group">
      <div role="treeitem">Alpha</div>
      <div role="treeitem">Beta</div>
      <div role="treeitem">Gamma</div>
    </div>
  </div>
</div>
@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent Accessibility This issue is related to accessibility (a11y) area: cdk/tree labels Nov 25, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
1 participant