diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 11609520643..b15d650b46b 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -5395,8 +5395,6 @@ export class ColumnFilter implements AfterContentInit { overlayId: any; - applyHasBeenClicked: boolean = false; - get fieldConstraints(): FilterMetadata[] | undefined | null { return this.dt.filters ? this.dt.filters[this.field] : null; } @@ -5651,11 +5649,6 @@ export class ColumnFilter implements AfterContentInit { } onEscape() { - if (this.hasFilterNotBeenApplied()) { - this.clearFilter(); - } - this.applyHasBeenClicked = false; - this.overlayVisible = false; this.icon?.nativeElement.focus(); } @@ -5755,10 +5748,6 @@ export class ColumnFilter implements AfterContentInit { return false; } - hasFilterNotBeenApplied(): boolean { - return this.hasFilter() && !this.applyHasBeenClicked; - } - isOutsideClicked(event: any): boolean { return !( DomHandler.hasClass(this.overlay?.nextElementSibling, 'p-overlay') || @@ -5833,10 +5822,6 @@ export class ColumnFilter implements AfterContentInit { } hide() { - if (this.hasFilterNotBeenApplied()) { - this.clearFilter(); - } - this.applyHasBeenClicked = false; this.overlayVisible = false; this.cd.markForCheck(); } @@ -5849,14 +5834,12 @@ export class ColumnFilter implements AfterContentInit { } clearFilter() { - this.applyHasBeenClicked = false; this.initFieldFilterConstraint(); this.dt._filter(); if (this.hideOnClear) this.hide(); } applyFilter() { - this.applyHasBeenClicked = true; this.dt._filter(); this.hide(); }