Fix ⌘-C opening the Assistant on Dvorak keyboard layouts (#4311)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Zeno Kapitein
2026-06-17 10:51:20 +02:00
committed by GitHub
parent 509389c7e5
commit 76550415ac
3 changed files with 15 additions and 0 deletions
@@ -0,0 +1,5 @@
---
"gitbook": patch
---
Match keyboard shortcuts by the logical character typed instead of the physical key position, so that ⌘-C no longer opens the Assistant on the Dvorak layout (and other non-QWERTY layouts).
@@ -51,6 +51,9 @@ export function AIChatInput(props: {
},
{
enableOnFormTags: true,
// Match the logical character so Dvorak ⌘-C (physical "I" key) copies
// instead of focusing the Assistant input. RND-11340.
ignoreEventWhen: (e) => e.key.toLowerCase() !== 'i',
}
);
@@ -69,6 +69,10 @@ export function SearchContainer({
},
{
enableOnFormTags: true,
// Match the logical character typed, not the physical key position, so
// non-QWERTY layouts don't trigger the shortcut by position (e.g. on
// Dvorak the physical "K"/"I" keys produce other characters). RND-11340.
ignoreEventWhen: (e) => e.key.toLowerCase() !== 'k',
}
);
@@ -84,6 +88,9 @@ export function SearchContainer({
},
{
enableOnFormTags: true,
// Match the logical character so Dvorak ⌘-C (physical "I" key) copies
// instead of opening the Assistant. RND-11340.
ignoreEventWhen: (e) => e.key.toLowerCase() !== 'i',
}
);