From c909fcc99ce71b92edfc80143d953ae51d0b3bbe Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 14 Mar 2025 09:46:57 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14343 --- app/src/protyle/wysiwyg/keydown.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index b57840a97..016f571c5 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -1239,12 +1239,12 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { !protyle.toolbar.subElement.classList.contains("fn__none")) { hideElements(["toolbar", "hint", "util"], protyle); protyle.hint.enableExtend = false; - } else if (nodeElement.classList.contains("protyle-wysiwyg--select")) { - hideElements(["select"], protyle); - countBlockWord([], protyle.block.rootID); } else if (!window.siyuan.menus.menu.element.classList.contains("fn__none")) { // 防止 ESC 时选中当前块 window.siyuan.menus.menu.remove(); + } else if (nodeElement.classList.contains("protyle-wysiwyg--select")) { + hideElements(["select"], protyle); + countBlockWord([], protyle.block.rootID); } else { hideElements(["select"], protyle); range.collapse(false); @@ -1749,11 +1749,11 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { const oldHTML = nodeElement.outerHTML; let text = ""; if (!event.shiftKey) { - range.extractContents().textContent.split("\n").forEach((item) => { + range.extractContents().textContent.split("\n").forEach((item: string) => { text += tabSpace + item + "\n"; }); } else { - range.extractContents().textContent.split("\n").forEach((item) => { + range.extractContents().textContent.split("\n").forEach((item: string) => { if (item.startsWith(tabSpace)) { text += item.replace(tabSpace, "") + "\n"; } else {