Skip to content

Commit 86f3d3d

Browse files
tyroneyehsilverwind
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 4f1408c commit 86f3d3d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

web_src/js/features/codeeditor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const baseOptions: MonacoOpts = {
3838
scrollbar: {horizontalScrollbarSize: 6, verticalScrollbarSize: 6, alwaysConsumeMouseWheel: false},
3939
scrollBeyondLastLine: false,
4040
automaticLayout: true,
41+
editContext: false, // https://github.com/microsoft/monaco-editor/issues/5081
4142
};
4243

4344
function getEditorconfig(input: HTMLInputElement): EditorConfig | null {

0 commit comments

Comments
 (0)