Skip to content

Commit 9694686

Browse files
JonasBaclaude
andcommitted
fix(cmdk): Restrict shiftKey modifier to Enter key only
Shift+Tab is a standard reverse-tab navigation gesture, not an "open in new tab" signal. Previously, both Enter and Tab forwarded e.shiftKey to onActionSelection, so Shift+Tab incorrectly triggered window.open instead of navigate in the modal handler. Now shiftKey is only forwarded when the triggering key is Enter. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
1 parent 12d0610 commit 9694686

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

static/app/components/commandPalette/ui/commandPalette.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,10 @@ export function CommandPalette(props: CommandPaletteProps) {
356356
}
357357

358358
if (e.key === 'Enter' || e.key === 'Tab') {
359+
// Only forward shiftKey for Enter — Shift+Tab is reverse tab
360+
// navigation, not an "open in new tab" gesture.
359361
onActionSelection(treeState.selectionManager.focusedKey, {
360-
modifierKeys: {shiftKey: e.shiftKey},
362+
modifierKeys: {shiftKey: e.key === 'Enter' && e.shiftKey},
361363
});
362364
return;
363365
}

0 commit comments

Comments
 (0)