mirror of
https://github.com/go-gitea/gitea.git
synced 2026-02-14 18:47:20 +01:00
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 <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user