From a7294085994f819761740e8272be2de3a1efbb52 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 4 Dec 2024 06:14:53 -0600 Subject: [PATCH] preserve search query in overlay state hook (#15334) --- web/src/hooks/use-overlay-state.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/hooks/use-overlay-state.tsx b/web/src/hooks/use-overlay-state.tsx index 75d738e61..841585b25 100644 --- a/web/src/hooks/use-overlay-state.tsx +++ b/web/src/hooks/use-overlay-state.tsx @@ -15,7 +15,10 @@ export function useOverlayState( (value: S, replace: boolean = false) => { const newLocationState = { ...currentLocationState }; newLocationState[key] = value; - navigate(location.pathname, { state: newLocationState, replace }); + navigate(location.pathname + location.search, { + state: newLocationState, + replace, + }); }, // we know that these deps are correct // eslint-disable-next-line react-hooks/exhaustive-deps