From 3033d09af2f0dffaaae78a81a68c2e22321cad64 Mon Sep 17 00:00:00 2001 From: WillDotWhite Date: Sat, 10 Aug 2024 10:43:55 +0100 Subject: [PATCH] Tidy up page behaviour on form change --- ui/src/pages/home/components/SearchFormWrapper.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/pages/home/components/SearchFormWrapper.tsx b/ui/src/pages/home/components/SearchFormWrapper.tsx index f792679..5989229 100644 --- a/ui/src/pages/home/components/SearchFormWrapper.tsx +++ b/ui/src/pages/home/components/SearchFormWrapper.tsx @@ -23,6 +23,10 @@ export const SearchFormWrapper: React.FC<{ delete formattedValues.timezoneEnd } + // When the form changes, reset the pagination back to page=1 + // Otherwise adding filtering leaves you on page=lots with no posts to view + formattedValues.page = "1" + // @ts-ignore setSearchParams(formattedValues) }