diff --git a/src/app/components/tree/tree.ts b/src/app/components/tree/tree.ts index c5affadc7d4..f5d520f8b30 100755 --- a/src/app/components/tree/tree.ts +++ b/src/app/components/tree/tree.ts @@ -1162,6 +1162,9 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo ngOnChanges(simpleChange: SimpleChanges) { if (simpleChange.value) { this.updateSerializedValue(); + if (this.hasFilterActive()) { + this._filter(this.filterViewChild.nativeElement.value); + } } } @@ -1395,6 +1398,10 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo return this.filter && this.filteredNodes && this.filteredNodes.length; } + hasFilterActive() { + return this.filter && this.filterViewChild?.nativeElement?.value.length > 0 + } + getNodeWithKey(key: string, nodes: TreeNode[]): TreeNode | undefined { for (let node of nodes) { if (node.key === key) {