mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 19:49:50 +01:00
fix: auto enter
This commit is contained in:
1 parent
4ff7d23027
commit
337398debe
1 file changed
+2
-2
@@ -36,7 +36,7 @@ export function SearchBar({ topResult }: SearchBarProps) {
|
|||||||
}, []);
|
}, []);
|
||||||
const handleKeyDown = useCallback<KeyboardEventHandler>(
|
const handleKeyDown = useCallback<KeyboardEventHandler>(
|
||||||
(event) => {
|
(event) => {
|
||||||
if (event.key !== 'Enter' || !topResult) return;
|
if (event.key !== 'Enter' || !topResult || searching) return;
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
router.push(`/tools/tankopedia/${topResult.id}`);
|
router.push(`/tools/tankopedia/${topResult.id}`);
|
||||||
@@ -58,7 +58,7 @@ export function SearchBar({ topResult }: SearchBarProps) {
|
|||||||
{searching ? <Spinner /> : <MagnifyingGlassIcon />}
|
{searching ? <Spinner /> : <MagnifyingGlassIcon />}
|
||||||
</TextField.Slot>
|
</TextField.Slot>
|
||||||
|
|
||||||
{topResult && (
|
{topResult && !searching && (
|
||||||
<TextField.Slot>
|
<TextField.Slot>
|
||||||
<Link href={`/tools/tankopedia/${topResult.id}`}>
|
<Link href={`/tools/tankopedia/${topResult.id}`}>
|
||||||
<Button variant="ghost">
|
<Button variant="ghost">
|
||||||
|
|||||||
Reference in new issue
Block a user