Skip to content

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

:art: Improve the drag-and-drop experience in the list and super block https://github.com/siyuan-note/siyuan/issues/17893

Daniel462ff70e5386
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index cf3f834995..7806a7d2a4 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -1126,7 +1126,10 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
}
}
if (nestedTarget) {
- dragSame(protyle, sourceElements, nestedTarget, isBottom, event.ctrlKey);
+ // 拖拽自身子列表项到父项位置时,nestedTarget 可能就是源项自身,需跳过避免自己拖到自己
+ if (!sourceElements.includes(nestedTarget)) {
+ dragSame(protyle, sourceElements, nestedTarget, isBottom, event.ctrlKey);
+ }
} else {
// 目标列表项无嵌套子列表:定位其最后一个内容块,在其后插入,
// moveTo 会自动创建嵌套列表包装源列表项,形成子项结构