From 71a8ed2966a41a8abd5f9b2d362aa383feb97d1d Mon Sep 17 00:00:00 2001 From: Shane Kennedy Date: Wed, 22 Apr 2026 09:27:09 +0200 Subject: [PATCH 1/2] fix: cmd+click should not close search pallete --- src/components/SearchModal.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/SearchModal.tsx b/src/components/SearchModal.tsx index b47dd7e3..a3f139bc 100644 --- a/src/components/SearchModal.tsx +++ b/src/components/SearchModal.tsx @@ -458,6 +458,10 @@ const Hit = ({ persistFramework(framework) } + if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) { + return + } + closeSearch() } From 2f32860cdc338220f691227bcc9eef3e841c7f27 Mon Sep 17 00:00:00 2001 From: Shane Kennedy Date: Wed, 22 Apr 2026 09:28:30 +0200 Subject: [PATCH 2/2] fix: cmd+k focuses cursor on search input --- src/components/SearchModal.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/SearchModal.tsx b/src/components/SearchModal.tsx index a3f139bc..44ca1bbe 100644 --- a/src/components/SearchModal.tsx +++ b/src/components/SearchModal.tsx @@ -829,6 +829,22 @@ export function SearchModal() { } }, [isOpen]) + React.useEffect(() => { + if (!isOpen) return + + const focusSearchInput = () => { + const input = containerRef.current?.querySelector( + 'input[type="search"]', + ) + input?.focus() + } + + const id = window.requestAnimationFrame(() => { + window.requestAnimationFrame(focusSearchInput) + }) + return () => window.cancelAnimationFrame(id) + }, [isOpen]) + const focusedIndexRef = React.useRef(focusedIndex) React.useEffect(() => { @@ -889,6 +905,7 @@ export function SearchModal() { className="fixed z-[1000] top-8 left-1/2 -translate-x-1/2 w-[98%] xl:w-full max-w-3xl text-left bg-white/80 dark:bg-black/80 shadow-lg rounded-lg xl:rounded-xl divide-y divide-gray-500/20 backdrop-blur-lg dark:border dark:border-white/20 outline-none" ref={containerRef} onKeyDown={handleKeyDown} + onOpenAutoFocus={(event) => event.preventDefault()} > Search TanStack docs @@ -916,8 +933,6 @@ export function SearchModal() { reset: 'p-1 opacity-50 hover:opacity-100', }} resetIconComponent={resetIconComponent} - // eslint-disable-next-line jsx-a11y/no-autofocus - autoFocus />