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/14177

Vanessa063110f271a9
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 07ba648ef5..798a83c3d0 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -1289,11 +1289,18 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
}
const fileTreeIds = (event.dataTransfer.types.includes(Constants.SIYUAN_DROP_FILE) && window.siyuan.dragElement) ? window.siyuan.dragElement.innerText : "";
if (event.shiftKey || (event.altKey && fileTreeIds.indexOf("-") === -1)) {
- const targetElement = hasClosestBlock(event.target);
- if (targetElement) {
- targetElement.classList.remove("dragover__top", "protyle-wysiwyg--select", "dragover__bottom", "dragover__left", "dragover__right");
- targetElement.removeAttribute("select-start");
- targetElement.removeAttribute("select-end");
+ const targetAssitElement = hasClosestBlock(event.target);
+ if (targetAssitElement) {
+ targetAssitElement.classList.remove("dragover__top", "protyle-wysiwyg--select", "dragover__bottom", "dragover__left", "dragover__right");
+ targetAssitElement.removeAttribute("select-start");
+ targetAssitElement.removeAttribute("select-end");
+ } else {
+ // https://github.com/siyuan-note/siyuan/issues/14177
+ editorElement.querySelectorAll(".dragover__top, .protyle-wysiwyg--select, .dragover__bottom, .dragover__left, .dragover__right").forEach((item: HTMLElement) => {
+ item.classList.remove("dragover__top", "protyle-wysiwyg--select", "dragover__bottom", "dragover__left", "dragover__right");
+ item.removeAttribute("select-start");
+ item.removeAttribute("select-end");
+ });
}
event.preventDefault();
return;