Skip to content

Commit

Permalink
Merge pull request #3819 from LeemansBE/feature/paging-bug
Browse files Browse the repository at this point in the history
bugfix paging for dynamic filtering in combination with PnP search filters
  • Loading branch information
wobba authored Jun 24, 2024
2 parents 683ba9a + 7cb38d8 commit a486cd3
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2461,16 +2461,17 @@ export default class SearchResultsWebPart extends BaseWebPart<ISearchResultsWebP
if (this._filtersConnectionSourceData) {
const filtersSourceData: IDataFilterSourceData = DynamicPropertyHelper.tryGetValueSafe(this._filtersConnectionSourceData);
if (filtersSourceData) {
const selectedFilters = dataContext.filters.selectedFilters.concat(filtersSourceData.selectedFilters);

// Reset the page number if filters have been updated by the user
if (!isEqual(filtersSourceData.selectedFilters, this._lastSelectedFilters)) {
if (!isEqual(selectedFilters, this._lastSelectedFilters)) {
dataContext.pageNumber = 1;
this.currentPageNumber = 1;
}

// Use the filter confiugration and then get the corresponding values
// Use the filter configuration and then get the corresponding values
dataContext.filters.filtersConfiguration = filtersSourceData.filterConfiguration;
dataContext.filters.selectedFilters = dataContext.filters.selectedFilters.concat(filtersSourceData.selectedFilters);
dataContext.filters.selectedFilters = selectedFilters;
dataContext.filters.filterOperator = filtersSourceData.filterOperator;
dataContext.filters.instanceId = filtersSourceData.instanceId;

Expand Down

0 comments on commit a486cd3

Please sign in to comment.