From 88067d99e3cb5c0c2a67b8f94ea2baf1a64265a1 Mon Sep 17 00:00:00 2001 From: Stefan Stoyanov Date: Tue, 6 Nov 2018 18:06:23 +0200 Subject: [PATCH] fix(igx-grid): Clear filter when value is cleared from input, #2945 --- .../src/lib/grids/filtering/grid-filtering.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering.service.ts b/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering.service.ts index 33ac282b511..1a3e8d5c6c2 100644 --- a/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering.service.ts +++ b/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering.service.ts @@ -204,6 +204,14 @@ export class IgxFilteringService implements OnDestroy { for (let i = 0; i < expressionsList.length; i++) { currExpressionUI = expressionsList[i]; + if (!currExpressionUI.expression.condition.isUnary && currExpressionUI.expression.searchVal === null) { + if (currExpressionUI.afterOperator === FilteringLogic.And && !currAndBranch) { + currAndBranch = new FilteringExpressionsTree(FilteringLogic.And, columnId); + expressionsTree.filteringOperands.push(currAndBranch); + } + continue; + } + if ((currExpressionUI.beforeOperator === undefined || currExpressionUI.beforeOperator === null || currExpressionUI.beforeOperator === FilteringLogic.Or) && currExpressionUI.afterOperator === FilteringLogic.And) {