fix: auto enter

This commit is contained in:
TrèsAbhi committed 2024-06-24 14:14:25 -05:00
1 parent 4ff7d23027
commit 337398debe
1 file changed
+2 -2
@@ -36,7 +36,7 @@ export function SearchBar({ topResult }: SearchBarProps) {
}, []);
const handleKeyDown = useCallback<KeyboardEventHandler>(
(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 ? <Spinner /> : <MagnifyingGlassIcon />}
</TextField.Slot>
{topResult && (
{topResult && !searching && (
<TextField.Slot>
<Link href={`/tools/tankopedia/${topResult.id}`}>
<Button variant="ghost">