Skip to content

Commit 030d556

Browse files
tyroneyehsilverwind
authored andcommitted
fix(repo-editor): disable Monaco editContext to avoid bugs with lost focus (go-gitea#36585)
Currently, pressing the space key in the Monaco editor scrolls the page instead of inserting a space if the editor is focused. This PR stops the space key event from propagating to parent elements, which prevents unwanted page scrolling while still allowing Monaco to handle space input normally. Changes: - disable Monaco editContext No changes to default editor behavior are needed; Monaco automatically inserts the space character. --------- Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io>
1 parent dcc794b commit 030d556

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

web_src/js/features/codeeditor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const baseOptions: MonacoOpts = {
3939
wordWrapBreakAfterCharacters: '',
4040
wordWrapBreakBeforeCharacters: '',
4141
matchBrackets: 'never',
42+
editContext: false, // https://github.com/microsoft/monaco-editor/issues/5081
4243
};
4344

4445
function getCodeEditorConfig(input: HTMLInputElement): CodeEditorConfig | null {

0 commit comments

Comments
 (0)