-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
bug(cdk-tree): aria-expanded attribute should not appear in the leaf node #21922
Comments
@jelbourn I would like to submit a PR for this. |
I was reported by a screenreader user that it is quite confusing to face the expanded attribute being set on leaf elements. For accessibility reasons I would also like to see the behavior described by W3.org as mentioned by @Yueyue07 |
As a screenreader user, I can exactly see the behaviour described by @Yueyue07 consistently with different screenreaders. So, screenreaders are relying on aria-expanded being correctly set to describe tree nodes and their current states. |
This is still an issue. Aria-expanded should only exist on node with children. Hopefully this can get fixed soon. Thanks! |
Hello folks, Fix in progress, see cdk-tree-revamp branch. |
… node fixed an issue where aria-expanded attribute was wrongly being added to leaf nodes Fixes angular#21922
…leaf node Fixed an issue to where leaf nodes were wrongly being assigned the aria-expanded attribute, which could confuse screen reader users. Fixes angular#21922
reworked unit tests for new tree configuration with aria-expanded Fixes angular#21922
fix cdk tests and approved goldens Fixes angular#21922
approved cdk golden Fixes angular#21922
refactored isLeafNode function to make more sense fixes angular#21922
fix comment Fixes angular#21922
refactored isLeafNode function to make more sense Fixes angular#21922
fix api golden Fixes angular#21922
fix change detection strategy Fixes angular#21922
revert last commit Fixes angular#21922
refactored isExpanded function again Fixes angular#21922
added aria-expanded to ngOnInit to get rid of ExpressionChangedAfterItHasBeenCheckedError Fixes angular#21922
…leaf node Fixed an issue to where leaf nodes were wrongly being assigned the aria-expanded attribute, which could confuse screen reader users. Fixes angular#21922
reworked unit tests for new tree configuration with aria-expanded Fixes angular#21922
fix cdk tests and approved goldens Fixes angular#21922
approved cdk golden Fixes angular#21922
refactored isLeafNode function to make more sense Fixes angular#21922
fix api golden Fixes angular#21922
fix change detection strategy Fixes angular#21922
revert last commit Fixes angular#21922
refactored isExpanded function again Fixes angular#21922
added aria-expanded to ngOnInit to get rid of ExpressionChangedAfterItHasBeenCheckedError Fixes angular#21922
fixed unit tests Fixes angular#21922
updated public api file Fixes angular#21922
new pr fixes angular#21922
…leaf node (angular#29096) * fix(material/tree): fixed unit tests fixed unit tests Fixes angular#21922 * fix(material/tree): updated public api file updated public api file Fixes angular#21922
fixed unit tests Fixes angular#21922
updated public api file Fixes angular#21922
…leaf node (angular#29096) * fix(material/tree): fixed unit tests fixed unit tests Fixes angular#21922 * fix(material/tree): updated public api file updated public api file Fixes angular#21922
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Reproduction
Example to reproduce issue
https://material.angular.io/cdk/tree/examples
Steps to reproduce:
Inspect the leaf node of cdk-tree from dev tools
Based on W3.org aria practices for tree view, it mentions that: "Each element with role treeitem that serves as a parent node has aria-expanded set to false when the node is in a closed state and set to true when the node is in an open state. End nodes do not have the aria-expanded attribute because, if they were to have it, they would be incorrectly described to assistive technologies as parent nodes."
Expected Behavior
There should be no aria-expanded attribute appearing on the leaf node
Actual Behavior
aria-expanded is setting as false on the leaf node
Environment
The text was updated successfully, but these errors were encountered: