diff --git a/src/app/components/tree/tree.ts b/src/app/components/tree/tree.ts index 44f7aa57054..1d0c4b5c325 100755 --- a/src/app/components/tree/tree.ts +++ b/src/app/components/tree/tree.ts @@ -1181,6 +1181,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); + } } } @@ -1414,6 +1417,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) {