From 4f2bca7e05a9e6b59eaf106e77fa26fc538c6e21 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 16 Jan 2023 23:44:44 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/7088 --- app/src/protyle/util/editorCommonEvent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 5d09226aa..da8d140b2 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -182,8 +182,8 @@ const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElemen action: "insert", id: copyId, data: copyElement.outerHTML, - previousID: position === "afterend" ? targetId : item.previousElementSibling?.getAttribute("data-node-id"), // 不能使用常量,移动后会被修改 - parentID: item.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID, + previousID: position === "afterend" ? targetId : copyElement.previousElementSibling?.getAttribute("data-node-id"), // 不能使用常量,移动后会被修改 + parentID: copyElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID, }); } else { tempTargetElement.insertAdjacentElement(position, item);