Skip to content

Commit

Permalink
reset page to 1 on filters change
Browse files Browse the repository at this point in the history
  • Loading branch information
alaister authored and joshenlim committed Mar 15, 2023
1 parent ed91d2b commit f17d009
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,14 @@ const ForeignRowSelector = ({
<FilterPopover
table={supaTable}
filters={params.filter ?? []}
setParams={setParams}
setParams={(...args) => {
// Reset page to 1 when filters change
if (page > 1) {
setPage(1)
}

setParams(...args)
}}
/>
<DndProvider backend={HTML5Backend}>
<SortPopover
Expand Down

0 comments on commit f17d009

Please sign in to comment.