Skip to content

Commit

Permalink
Fixed #15761 - Component: p-tree (selection)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Jul 10, 2024
1 parent e804cd6 commit fb957eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1358,15 +1358,19 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo
this.onNodeUnselect.emit({ originalEvent: event, node: node });
} else {
this.selection = node;
this.onNodeSelect.emit({ originalEvent: event, node: node });
setTimeout(() => {
this.onNodeSelect.emit({ originalEvent: event, node: node });
});
}
} else {
if (selected) {
this.selection = this.selection.filter((val: TreeNode, i: number) => i != index);
this.onNodeUnselect.emit({ originalEvent: event, node: node });
} else {
this.selection = [...(this.selection || []), node];
this.onNodeSelect.emit({ originalEvent: event, node: node });
setTimeout(() => {
this.onNodeSelect.emit({ originalEvent: event, node: node });
});
}
}

Expand Down

0 comments on commit fb957eb

Please sign in to comment.