Skip to content

Commit

Permalink
don't treat lazy tree items as leaf nodes (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-cumplido committed Nov 23, 2022
1 parent 7f9b0bd commit f3e2737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/tree-item/tree-item.ts
Expand Up @@ -96,7 +96,7 @@ export default class SlTreeItem extends ShoelaceElement {
this.childrenContainer.hidden = !this.expanded;
this.childrenContainer.style.height = this.expanded ? 'auto' : '0';

this.isLeaf = this.getChildrenItems().length === 0;
this.isLeaf = !this.lazy && this.getChildrenItems().length === 0;
this.handleExpandedChange();
}

Expand Down Expand Up @@ -202,7 +202,7 @@ export default class SlTreeItem extends ShoelaceElement {

handleChildrenSlotChange() {
this.loading = false;
this.isLeaf = this.getChildrenItems().length === 0;
this.isLeaf = !this.lazy && this.getChildrenItems().length === 0;
}

protected willUpdate(changedProperties: PropertyValueMap<SlTreeItem> | Map<PropertyKey, unknown>): void {
Expand Down

0 comments on commit f3e2737

Please sign in to comment.