From 514f322dcf1fa245dffd8f2a6e3f446ab1d0f09e Mon Sep 17 00:00:00 2001 From: Tyrone Yeh Date: Fri, 13 Feb 2026 02:39:24 +0800 Subject: [PATCH] fix(repo-editor): disable Monaco `editContext` to avoid bugs with lost focus (#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 Co-authored-by: silverwind --- web_src/js/features/codeeditor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/js/features/codeeditor.ts b/web_src/js/features/codeeditor.ts index 94c7e18234..47f378c47a 100644 --- a/web_src/js/features/codeeditor.ts +++ b/web_src/js/features/codeeditor.ts @@ -39,6 +39,7 @@ const baseOptions: MonacoOpts = { wordWrapBreakAfterCharacters: '', wordWrapBreakBeforeCharacters: '', matchBrackets: 'never', + editContext: false, // https://github.com/microsoft/monaco-editor/issues/5081 }; function getCodeEditorConfig(input: HTMLInputElement): CodeEditorConfig | null {