From 86f3d3dc4c7e12cf40ced913f73dc5c2f58645cd Mon Sep 17 00:00:00 2001 From: Tyrone Yeh Date: Fri, 13 Feb 2026 08:58:19 +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 24af0d72c3355..1291c019bac25 100644 --- a/web_src/js/features/codeeditor.ts +++ b/web_src/js/features/codeeditor.ts @@ -38,6 +38,7 @@ const baseOptions: MonacoOpts = { scrollbar: {horizontalScrollbarSize: 6, verticalScrollbarSize: 6, alwaysConsumeMouseWheel: false}, scrollBeyondLastLine: false, automaticLayout: true, + editContext: false, // https://github.com/microsoft/monaco-editor/issues/5081 }; function getEditorconfig(input: HTMLInputElement): EditorConfig | null {