Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/17964

Daniel33db982a88b2
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 9a6deb9958..7d829f85d4 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -1125,7 +1125,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
source.contains(targetLi) || // 拖到子孙中
(!isChild && isBottom && source === targetLi.nextElementSibling) || // 底部同级:源原本就在目标后面
(!isChild && !isBottom && source === targetLi.previousElementSibling)); // 顶部同级:源原本就在目标前面
- if (isNoOpDrop) {
+ // Ctrl(复制)/Shift(嵌入) 允许落在源自身/原位置(创建副本/嵌入块),不做 no-op 拦截
+ if (isNoOpDrop && !event.ctrlKey && !event.shiftKey) {
dragoverElement = undefined;
return;
}
@@ -2181,7 +2182,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
return true;
}
});
- if (isSelf && "nodeattributeviewrowmenu" !== gutterTypes[0]) {
+ if (isSelf && "nodeattributeviewrowmenu" !== gutterTypes[0] && !event.ctrlKey && !event.shiftKey) {
+ // 拖到自身/子孙时无操作;但 Ctrl(复制)/Shift(嵌入) 允许落在源自身位置(创建副本/嵌入块),不拦截
clearDragoverElement(dragoverElement);
return;
}