From 941fb7b514d11574cf3e16de0beb1fc12b30a808 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 17 Oct 2022 20:53:13 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/6239 --- app/src/protyle/util/editorCommonEvent.ts | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 88b791b6f..5a22f37e3 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -295,6 +295,19 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E }); }); undoOperations.reverse(); + if (newSourceElement.getAttribute("data-subtype") === "o") { + undoOperations.splice(0, 0,{ + action: "update", + id: newSourceElement.getAttribute("data-node-id"), + data: newSourceElement.outerHTML + }); + updateListOrder(newSourceElement, 1); + doOperations.push({ + action: "update", + id: newSourceElement.getAttribute("data-node-id"), + data: newSourceElement.outerHTML + }); + } undoOperations.push({ action: "delete", id: newSourceElement.getAttribute("data-node-id"), @@ -369,6 +382,19 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E }); }); undoOperations.reverse(); + if (newSourceElement.getAttribute("data-subtype") === "o") { + undoOperations.splice(0, 0,{ + action: "update", + id: newSourceElement.getAttribute("data-node-id"), + data: newSourceElement.outerHTML + }); + updateListOrder(newSourceElement, 1); + doOperations.push({ + action: "update", + id: newSourceElement.getAttribute("data-node-id"), + data: newSourceElement.outerHTML + }); + } undoOperations.push({ action: "delete", id: newSourceElement.getAttribute("data-node-id"),