From 8e412ababfc21888b705311ca45c9f12d7ca42e2 Mon Sep 17 00:00:00 2001 From: Tyrone Yeh Date: Fri, 13 Feb 2026 12:00:17 +0800 Subject: [PATCH] Fix focus lost bugs in the Monaco editor (#36609) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …t 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 24af0d72c3..1291c019ba 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 {