- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.9k
 
Fix keyboard shortcuts not working in CodeMirror editor fields #5901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ditors Co-authored-by: Pragadesh44-Bruno <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot completely remove the changes from the package-lock.json since it is irrelevant to the fix for this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted package-lock.json changes in commit 7fda0fc.
| 'Cmd-PageUp': () => CodeMirror.Pass, | ||
| 'Ctrl-PageUp': () => CodeMirror.Pass, | ||
| 'Cmd-PageDown': () => CodeMirror.Pass, | ||
| 'Ctrl-PageDown': () => CodeMirror.Pass, | ||
| 'Cmd-Shift-PageUp': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-PageUp': () => CodeMirror.Pass, | ||
| 'Cmd-Shift-PageDown': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-PageDown': () => CodeMirror.Pass | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot remove these lines. it is irrelevant to this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed Shift+W and Shift+PageUp/Down shortcuts in commit 7fda0fc. Only kept Ctrl+W and Ctrl+PageUp/Down as mentioned in the issue.
| 'Cmd-PageUp': () => CodeMirror.Pass, | ||
| 'Ctrl-PageUp': () => CodeMirror.Pass, | ||
| 'Cmd-PageDown': () => CodeMirror.Pass, | ||
| 'Ctrl-PageDown': () => CodeMirror.Pass, | ||
| 'Cmd-Shift-PageUp': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-PageUp': () => CodeMirror.Pass, | ||
| 'Cmd-Shift-PageDown': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-PageDown': () => CodeMirror.Pass | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot remove these lines. it is irrelevant to this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed Shift+W and Shift+PageUp/Down shortcuts in commit 7fda0fc.
| 'Cmd-Shift-W': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-W': () => CodeMirror.Pass, | ||
| 'Cmd-PageUp': () => CodeMirror.Pass, | ||
| 'Ctrl-PageUp': () => CodeMirror.Pass, | ||
| 'Cmd-PageDown': () => CodeMirror.Pass, | ||
| 'Ctrl-PageDown': () => CodeMirror.Pass, | ||
| 'Cmd-Shift-PageUp': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-PageUp': () => CodeMirror.Pass, | ||
| 'Cmd-Shift-PageDown': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-PageDown': () => CodeMirror.Pass | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot remove these lines. it is irrelevant to this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed Shift+W and Shift+PageUp/Down shortcuts in commit 7fda0fc.
| 'Cmd-PageUp': () => CodeMirror.Pass, | ||
| 'Ctrl-PageUp': () => CodeMirror.Pass, | ||
| 'Cmd-PageDown': () => CodeMirror.Pass, | ||
| 'Ctrl-PageDown': () => CodeMirror.Pass, | ||
| 'Cmd-Shift-PageUp': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-PageUp': () => CodeMirror.Pass, | ||
| 'Cmd-Shift-PageDown': () => CodeMirror.Pass, | ||
| 'Ctrl-Shift-PageDown': () => CodeMirror.Pass | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot remove these lines. it is irrelevant to this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed Shift+W and Shift+PageUp/Down shortcuts in commit 7fda0fc.
…Up/Down Co-authored-by: Pragadesh44-Bruno <[email protected]>
Tab navigation shortcuts (
Ctrl+W,Ctrl+PageUp/Down) were intercepted by CodeMirror's textarea and never reached the global Mousetrap handlers. Other shortcuts likeCtrl+PageUp/Downfor tab switching also failed when focus was in any editor field.Changes
Added pass-through configuration for tab navigation shortcuts in all CodeMirror editor components:
Each editor's
extraKeysnow returnsCodeMirror.Passfor these shortcuts, allowing events to propagate to global handlers:This follows the existing pattern used for disabling Tab key (
Tab: false) and allowsCtrl+Sto continue working as explicitly handled in extraKeys.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.