From fb957eb1224063a3631fbe9b6172eb6544d38857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:46:26 +0300 Subject: [PATCH] Fixed #15761 - Component: p-tree (selection) --- src/app/components/tree/tree.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/components/tree/tree.ts b/src/app/components/tree/tree.ts index 7e6e56987dd..afe15afd9ec 100755 --- a/src/app/components/tree/tree.ts +++ b/src/app/components/tree/tree.ts @@ -1358,7 +1358,9 @@ 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) { @@ -1366,7 +1368,9 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo 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 }); + }); } }