update: codeblock disabled keydown propagation

This commit is contained in:
yanmao 2022-01-05 21:53:06 +08:00
parent d822e04c0d
commit 65cd8246d7
2 changed files with 2 additions and 0 deletions

View File

@ -133,6 +133,7 @@ class CodeBlockEditor implements CodeBlockEditorInterface {
}, },
}); });
this.codeMirror.on('keydown', (editor, event) => { this.codeMirror.on('keydown', (editor, event) => {
event.stopPropagation();
const lineCount = editor.lineCount(); const lineCount = editor.lineCount();
const { line, ch } = editor.getCursor(); const { line, ch } = editor.getCursor();
const { onUpFocus, onDownFocus, onLeftFocus, onRightFocus } = const { onUpFocus, onDownFocus, onLeftFocus, onRightFocus } =

View File

@ -96,6 +96,7 @@ class CodeBlockEditor implements CodeBlockEditorInterface {
if (onFocus) onFocus(); if (onFocus) onFocus();
}); });
this.codeMirror.on('keydown', (editor, event) => { this.codeMirror.on('keydown', (editor, event) => {
event.stopPropagation();
const lineCount = editor.lineCount(); const lineCount = editor.lineCount();
const { line, ch } = editor.getCursor(); const { line, ch } = editor.getCursor();
const { onUpFocus, onDownFocus, onLeftFocus, onRightFocus } = const { onUpFocus, onDownFocus, onLeftFocus, onRightFocus } =