Skip to content

Commit

Permalink
fix(admin-ui): Set page to 1 when changing list filters
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jul 4, 2023
1 parent 62d1c3b commit f2f60c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class BaseListComponent<ResultType, ItemType, VariableType extends Record
const searchTerm$ = this.searchTermControl.valueChanges.pipe(
filter(value => value !== null && (2 < value.length || value.length === 0)),
debounceTime(250),
tap(() => this.setPageNumber(1)),
);

merge(searchTerm$, ...streams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class DataTableFilterCollection<FilterInput extends Record<string, any> =
connectToRoute(route: ActivatedRoute) {
this.valueChanges.subscribe(value => {
this.router.navigate(['./'], {
queryParams: { [this.#filtersQueryParamName]: this.serialize() },
queryParams: { [this.#filtersQueryParamName]: this.serialize(), page: 1 },
relativeTo: route,
queryParamsHandling: 'merge',
});
Expand Down

0 comments on commit f2f60c3

Please sign in to comment.