From 559ef4aae7c467fbd9e4538648b6f0c764eee0f8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 5 Dec 2022 20:58:59 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/6786 --- app/src/protyle/wysiwyg/keydown.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 61ad3f126..d95c4457f 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -689,7 +689,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { // https://github.com/siyuan-note/siyuan/issues/5547 const previousSibling = hasPreviousSibling(range.startContainer) as HTMLElement; if (range.startOffset === 1 && range.startContainer.textContent === Constants.ZWSP && - previousSibling && previousSibling.nodeType !== 3) { + previousSibling && previousSibling.nodeType !== 3 && + event.key === "Backspace" // https://github.com/siyuan-note/siyuan/issues/6786 + ) { if (previousSibling.classList.contains("img")) { previousSibling.classList.add("img--select"); } else if (previousSibling.getAttribute("data-type")?.indexOf("inline-math") > -1) {