Skip to content

Commit

Permalink
fix(design): only add the aria expanded attribute when tree item has …
Browse files Browse the repository at this point in the history
…children (#2886)
  • Loading branch information
xelaint committed Jun 20, 2024
1 parent 10bd1e9 commit 3d1796f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/design/tree/src/tree-item/tree-item.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ export class DaffTreeItemDirective {
set node(val: DaffTreeFlatNode) {
this._node = val;
this.id = 'tree-' + this._node.id;
this.ariaExpanded = this._node._treeRef.open ? 'true' : 'false';
this.depth = this._node.level;
this.classParent = this._node.hasChildren;
this.openClass = this._node._treeRef.open;

if(this._node.hasChildren) {
this.ariaExpanded = this._node._treeRef.open ? 'true' : 'false';
}
}

/**
Expand Down

0 comments on commit 3d1796f

Please sign in to comment.