fix autonavigation

This commit is contained in:
Johannes Kirschbauer 2024-01-08 21:04:57 +01:00 committed by Johannes Kirschbauer
parent c5ebb4f20c
commit 8508ff085c

View File

@ -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)}