mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-25 11:52:10 +00:00
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:
@@ -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',
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user