Skip to content

Commit d908d8e

Browse files
committed
fix(grid): clear filter on empty input in the landing marathon sample
1 parent b2aad5f commit d908d8e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

projects/app-lob/src/app/grid/grid-boston-marathon/grid.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,12 @@ export class GridComponent implements OnInit, OnDestroy, AfterViewInit {
197197
}
198198

199199
public filter(target: EventTarget): void {
200-
this.grid1.filter('CountryName', (target as HTMLInputElement).value, IgxStringFilteringOperand.instance().condition('contains'), true);
201-
this.grid1.markForCheck();
200+
const value = (target as HTMLInputElement).value;
201+
if (value) {
202+
this.grid1.filter('CountryName', value, IgxStringFilteringOperand.instance().condition('contains'));
203+
} else {
204+
this.grid1.clearFilter('CountryName');
205+
}
202206
}
203207

204208
public showAlert(element: ElementRef): void {

0 commit comments

Comments
 (0)