From 8508ff085c04d36d1bb928e54a8819a2f5b8bce7 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Mon, 8 Jan 2024 21:04:57 +0100 Subject: [PATCH] fix autonavigation --- website/src/components/searchInput/searchInput.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/website/src/components/searchInput/searchInput.tsx b/website/src/components/searchInput/searchInput.tsx index 2eb2938..07d09fe 100644 --- a/website/src/components/searchInput/searchInput.tsx +++ b/website/src/components/searchInput/searchInput.tsx @@ -78,13 +78,13 @@ export function SearchInput(props: SearchInputProps) { includeInputInList aria-label={"search"} onInputChange={(e, value, reason) => { - if (reason === "reset") { - console.log({ value, reason }); - handleSubmit(value); - // if (value) { - // router.push(`/f/${value.split(".").join("/")}`); - // } else { - // } + if (reason === "reset" && e) { + console.log({ e, value, reason }); + if (value) { + router.push(`/f/${value.split(".").join("/")}`); + } else { + handleSubmit(value); + } } }} options={data.map((e) => e.meta.title)}