Summary
The document-level keydown handler in CommandPalette.tsx fires on all events regardless of which element is focused. If a user is typing in an <input>, <textarea>, <select>, or contentEditable element and presses Ctrl/Cmd+K, the palette opens and steals focus, interrupting their workflow.
Affected file
src/UILayer/web/src/components/shared/CommandPalette.tsx — lines 41-50
Required fix
function handleKeyDown(e: KeyboardEvent) {
const target = e.target as HTMLElement | null
if (
target &&
(target.tagName === 'INPUT' ||
target.tagName === 'TEXTAREA' ||
target.tagName === 'SELECT' ||
target.isContentEditable)
) {
return
}
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
e.preventDefault()
setOpen((prev) => !prev)
}
}
References