Skip to content

Commit

Permalink
Merge pull request #15991 from primefaces/issue-15761
Browse files Browse the repository at this point in the history
Fixed #15761 - Component: p-tree (selection)
  • Loading branch information
cetincakiroglu authored Jul 11, 2024
2 parents 866c5a8 + fb957eb commit 06ae38b
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 @@ -1353,15 +1353,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 06ae38b

Please sign in to comment.