Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(filtering): handle multiple events firing for column of type date #10233 #10268

Merged
merged 10 commits into from
Nov 15, 2021
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
Loading