Skip to content

bug(cdk-tree): aria-expanded attribute should not appear in the leaf node #21922

@Yueyue07

Description

@Yueyue07

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
image
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

  • CDK/Material: newest version

Metadata

Metadata

Assignees

Labels

AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/tree

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions