This commit is contained in:
Vanessa 2023-01-16 23:44:44 +08:00
parent 4b9ecb5f63
commit 4f2bca7e05

View file

@ -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);