mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-07-09 16:00:59 +00:00
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:
parent
28d2413c71
commit
cc1ebb569f
1 changed files with 8 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue