Skip to content

Commit

Permalink
[ui] Reset pagination page number whenever any search filter change (#…
Browse files Browse the repository at this point in the history
…233)

### Current behavior
Whenever I update a search filter, the pagination is stuck on whatever
was the previous selected page. If the new search filter yields fewer
search results than before, this can result in an search result page
even if there are search results on lower page numbers.

### Expected behavior
Whenever I update a search filter I expect the pagination to be reset to
page 1

### Proposed Fix
Reset pagination page number when filter query is updated
  • Loading branch information
jonalu authored Apr 11, 2024
2 parents 8c4f3eb + 198d03e commit 027df42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/src/app/search/search-filter-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function searchFilterReducer(
...state,
queries: { ...state.queries, [name]: query },
values: { ...state.values, [name]: values },
pagination: { ...state.pagination, pageNumber: 1 },
};
}
case "reset_all":
Expand Down

0 comments on commit 027df42

Please sign in to comment.