From def1ac632a8955719695bc1dfbde905d8475b318 Mon Sep 17 00:00:00 2001 From: sphinxrave <62570796+sphinxrave@users.noreply.github.com> Date: Tue, 31 Dec 2024 17:21:43 -0800 Subject: [PATCH] made search work with enterkey (huge) --- .../header/searchbar/components/SearchBar.tsx | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/react/src/components/header/searchbar/components/SearchBar.tsx b/packages/react/src/components/header/searchbar/components/SearchBar.tsx index 3be77f724..b7a6dd931 100644 --- a/packages/react/src/components/header/searchbar/components/SearchBar.tsx +++ b/packages/react/src/components/header/searchbar/components/SearchBar.tsx @@ -1,5 +1,10 @@ import { CommandList, Command as CommandPrimitive } from "cmdk"; -import { Command, CommandGroup, CommandShortcut } from "@/shadcn/ui/command"; +import { + Command, + CommandGroup, + CommandItem, + CommandShortcut, +} from "@/shadcn/ui/command"; import { cn } from "@/lib/utils"; import { queryAtom, @@ -139,10 +144,12 @@ export function SearchBar({ className="ml-2 flex-1 bg-transparent outline-none placeholder:text-base-8" />
- - - - + {query.length > 0 && ( + + {/* */} + + + )}