From 65cd8246d774d19fe721067f3f78ede58325ccb8 Mon Sep 17 00:00:00 2001 From: yanmao <55792257+yanmao-cc@users.noreply.github.com> Date: Wed, 5 Jan 2022 21:53:06 +0800 Subject: [PATCH] update: codeblock disabled keydown propagation --- plugins/codeblock-vue/src/component/editor.ts | 1 + plugins/codeblock/src/component/editor.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/codeblock-vue/src/component/editor.ts b/plugins/codeblock-vue/src/component/editor.ts index 61053f13..5b54aae2 100644 --- a/plugins/codeblock-vue/src/component/editor.ts +++ b/plugins/codeblock-vue/src/component/editor.ts @@ -133,6 +133,7 @@ class CodeBlockEditor implements CodeBlockEditorInterface { }, }); this.codeMirror.on('keydown', (editor, event) => { + event.stopPropagation(); const lineCount = editor.lineCount(); const { line, ch } = editor.getCursor(); const { onUpFocus, onDownFocus, onLeftFocus, onRightFocus } = diff --git a/plugins/codeblock/src/component/editor.ts b/plugins/codeblock/src/component/editor.ts index f40c528b..8a3262bb 100644 --- a/plugins/codeblock/src/component/editor.ts +++ b/plugins/codeblock/src/component/editor.ts @@ -96,6 +96,7 @@ class CodeBlockEditor implements CodeBlockEditorInterface { if (onFocus) onFocus(); }); this.codeMirror.on('keydown', (editor, event) => { + event.stopPropagation(); const lineCount = editor.lineCount(); const { line, ch } = editor.getCursor(); const { onUpFocus, onDownFocus, onLeftFocus, onRightFocus } =