Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/11048

Vanessa1e12bfeadd8d
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 478101506f..e1c9cb3eda 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -874,20 +874,22 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
const undoOperations: IOperation[] = [];
const undoPreviousId = blockElement.querySelector(`[data-id="${selectedIds[0]}"]`).previousElementSibling.getAttribute("data-id") || "";
selectedIds.reverse().forEach(item => {
- doOperations.push({
- action: "sortAttrViewRow",
- avID,
- previousID,
- id: item,
- blockID: blockElement.dataset.nodeId,
- });
- undoOperations.push({
- action: "sortAttrViewRow",
- avID,
- previousID: undoPreviousId,
- id: item,
- blockID: blockElement.dataset.nodeId,
- });
+ if (previousID !== item) {
+ doOperations.push({
+ action: "sortAttrViewRow",
+ avID,
+ previousID,
+ id: item,
+ blockID: blockElement.dataset.nodeId,
+ });
+ undoOperations.push({
+ action: "sortAttrViewRow",
+ avID,
+ previousID: undoPreviousId,
+ id: item,
+ blockID: blockElement.dataset.nodeId,
+ });
+ }
});
transaction(protyle, doOperations, undoOperations);
} else {