From 19dba40fc1c5695ded686d8b5082179879f75081 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 11 Jul 2022 14:46:15 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5396 --- app/src/protyle/util/editorCommonEvent.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 6f5bbb768..32ae680f1 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -590,7 +590,13 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { } transaction(protyle, doOperations, undoOperations); mathRender(protyle.wysiwyg.element); - focusByWbr(protyle.wysiwyg.element, range); + if (targetElement.classList.contains("code-block")) { + highlightRender(protyle.wysiwyg.element); + } else { + focusByWbr(protyle.wysiwyg.element, range); + } + // 拖拽后无法使用快捷键 + protyle.selectElement.classList.add("fn__none"); }); return; }