Skip to content

Commit a4a8910

Browse files
committed
fix(material/tree): aria-expanded attribute should not appear in the leaf node
Fixed an issue to where leaf nodes were wrongly being assigned the aria-expanded attribute, which could confuse screen reader users. Fixes #21922
1 parent 57a29b9 commit a4a8910

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cdk/tree/tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export class CdkTree<T, K = T> implements AfterContentChecked, CollectionViewer,
321321
exportAs: 'cdkTreeNode',
322322
host: {
323323
'class': 'cdk-tree-node',
324-
'[attr.aria-expanded]': 'isLeafNode ? null : isExpanded',
324+
'[attr.aria-expanded]': 'isExpanded',
325325
},
326326
standalone: true,
327327
})

0 commit comments

Comments
 (0)