@@ -337,8 +337,7 @@ export class CdkTreeNode<T> implements FocusableOption, OnDestroy {
337
337
}
338
338
339
339
/**
340
- * The role of the node should be 'group' if it's an internal node,
341
- * and 'treeitem' if it's a leaf node.
340
+ * The role of the node should always be 'treeitem'.
342
341
*/
343
342
@Input ( ) role : 'treeitem' | 'group' = 'treeitem' ;
344
343
@@ -363,10 +362,10 @@ export class CdkTreeNode<T> implements FocusableOption, OnDestroy {
363
362
focus ( ) : void {
364
363
this . _elementRef . nativeElement . focus ( ) ;
365
364
}
366
-
365
+
367
366
protected _setRoleFromData ( ) : void {
368
367
if ( this . _tree . treeControl . isExpandable ) {
369
- this . role = this . _tree . treeControl . isExpandable ( this . _data ) ? 'group ' : 'treeitem' ;
368
+ this . role = this . _tree . treeControl . isExpandable ( this . _data ) ? 'treeitem ' : 'treeitem' ;
370
369
} else {
371
370
if ( ! this . _tree . treeControl . getChildren ) {
372
371
throw getTreeControlFunctionsMissingError ( ) ;
@@ -376,12 +375,12 @@ export class CdkTreeNode<T> implements FocusableOption, OnDestroy {
376
375
this . _setRoleFromChildren ( childrenNodes as T [ ] ) ;
377
376
} else if ( isObservable ( childrenNodes ) ) {
378
377
childrenNodes . pipe ( takeUntil ( this . _destroyed ) )
379
- . subscribe ( children => this . _setRoleFromChildren ( children ) ) ;
378
+ . subscribe ( children => this . _setRoleFromChildren ( children ) ) ;
380
379
}
381
380
}
382
381
}
383
382
384
383
protected _setRoleFromChildren ( children : T [ ] ) {
385
- this . role = children && children . length ? 'group' : 'treeitem' ;
384
+ this . role = 'treeitem' ;
386
385
}
387
386
}
0 commit comments