fix(keyboard): Cmd+K command palette works from editable fields

The isEditableTarget early-return blocked Cmd+K when focus was in any
input, textarea, or select element. The command palette shortcut must
work from anywhere — it is the primary keyboard navigation path.

Move the Cmd+K check before the editable-target guard.
This commit is contained in:
rcourtman 2026-06-27 17:20:28 +01:00
parent 28d2413c71
commit cc1ebb569f

View file

@ -129,11 +129,17 @@ export function useKeyboardShortcuts(options: KeyboardShortcutsOptions = {}) {
return;
}
if (isEditableTarget(e.target)) {
const key = e.key.toLowerCase();
if ((e.metaKey || e.ctrlKey) && key === 'k') {
e.preventDefault();
openCommandPalette();
return;
}
const key = e.key.toLowerCase();
if (isEditableTarget(e.target)) {
return;
}
if (key === 'g' && !awaitingSecondKey() && !e.metaKey && !e.ctrlKey && !e.altKey) {
if (!e.repeat) {