(core) Fix filtering regression

Summary:
Fixes a recent regression that would cause a record to be erroneously filtered
out whenever it was updated from a linked view.

Test Plan: Browser test.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D4163
This commit is contained in:
George Gevoian
2024-01-15 14:24:51 -08:00
parent 7c7dc5a0ef
commit b82209b458
5 changed files with 47 additions and 11 deletions

View File

@@ -79,13 +79,11 @@ function BaseView(gristDoc, viewSectionModel, options) {
// Create a section filter and a filtered row source that subscribes to its changes.
// `sectionFilter` also provides `setFilterOverride()` to allow controlling a filter from a column menu.
// Whenever changes are made to filters, exempt rows are reset.
this._sectionFilter = SectionFilter.create(
this, this.viewSection, this.tableModel.tableData, () => this._exemptFromFilterRows.reset()
);
this._sectionFilter = SectionFilter.create(this, this.viewSection, this.tableModel.tableData);
this._filteredRowSource = rowset.FilteredRowSource.create(this, this._sectionFilter.sectionFilterFunc.get());
this._filteredRowSource.subscribeTo(this._mainRowSource);
this.autoDispose(this._sectionFilter.sectionFilterFunc.addListener(filterFunc => {
this._exemptFromFilterRows.reset();
this._filteredRowSource.updateFilter(filterFunc);
}));