Skip to content

Commit

Permalink
fix(filtering): handle multiple events firing for column of type date #…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhosti committed Oct 11, 2021
1 parent ca81912 commit 6ebfaba
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { AbsoluteScrollStrategy } from '../../../services/overlay/scroll';
import { DisplayDensity } from '../../../core/displayDensity';
import { IgxDatePickerComponent } from '../../../date-picker/date-picker.component';
import { IgxTimePickerComponent } from '../../../time-picker/time-picker.component';
import { PlatformUtil } from '../../../core/utils';
import { isEqual, PlatformUtil } from '../../../core/utils';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

Expand Down Expand Up @@ -70,14 +70,23 @@ export class IgxGridFilteringRowComponent implements AfterViewInit, OnDestroy {
public set value(val) {
if (!val && val !== 0) {
this.expression.searchVal = null;
this.showHideArrowButtons();
const index = this.expressionsList.findIndex(item => item.expression === this.expression);
if (index === 0 && this.expressionsList.length === 1) {
this.clearFiltering();
return;
}
} else {
const oldValue = this.expression.searchVal;
if (isEqual(oldValue, val)) {
return;
}

this.expression.searchVal = DataUtil.parseValue(this.column.dataType, val);
if (this.expressionsList.find(item => item.expression === this.expression) === undefined) {
this.addExpression(true);
}
this.filter();
}
this.filter();
}

public get displayDensity() {
Expand Down

0 comments on commit 6ebfaba

Please sign in to comment.