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

Daniel55194541f900
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 9f3f9d4be5..5510a11961 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -1861,7 +1861,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
const lis = targetElement.querySelectorAll(":scope > .li");
const lastLi = lis[lis.length - 1];
const firstLi = lis[0];
- const isListBottom = event.clientY > targetElement.getBoundingClientRect().top + targetElement.getBoundingClientRect().height / 2;
+ const listRect = targetElement.getBoundingClientRect();
+ const isListBottom = event.clientY > listRect.top + listRect.height / 2;
const sourceIds = Array.from(editorElement.querySelectorAll(".protyle-wysiwyg--select"))
.map((e: HTMLElement) => e.getAttribute("data-node-id"));
const isNoOpList = (isListBottom && lastLi && sourceIds.includes(lastLi.getAttribute("data-node-id"))) ||