From 337398debeb645e5d4416f54feb9132c477fe3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:14:25 -0500 Subject: [PATCH] fix: auto enter --- src/app/tools/tankopedia/components/SearchBar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tools/tankopedia/components/SearchBar.tsx b/src/app/tools/tankopedia/components/SearchBar.tsx index e5287fcba..a7b0973a1 100644 --- a/src/app/tools/tankopedia/components/SearchBar.tsx +++ b/src/app/tools/tankopedia/components/SearchBar.tsx @@ -36,7 +36,7 @@ export function SearchBar({ topResult }: SearchBarProps) { }, []); const handleKeyDown = useCallback( (event) => { - if (event.key !== 'Enter' || !topResult) return; + if (event.key !== 'Enter' || !topResult || searching) return; event.preventDefault(); router.push(`/tools/tankopedia/${topResult.id}`); @@ -58,7 +58,7 @@ export function SearchBar({ topResult }: SearchBarProps) { {searching ? : } - {topResult && ( + {topResult && !searching && (