From ffd6459540a55dcf8470fd797e43aa95c1047714 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 25 Mar 2024 10:23:03 +0800 Subject: [PATCH] :lipstick: fix https://github.com/siyuan-note/siyuan/issues/10727 --- app/src/constants.ts | 9 +-------- app/src/protyle/util/editorCommonEvent.ts | 3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/src/constants.ts b/app/src/constants.ts index 7b8ad9715..cd46b2137 100644 --- a/app/src/constants.ts +++ b/app/src/constants.ts @@ -482,14 +482,7 @@ export abstract class Constants { "size": "auto", "type": "center", "instance": "Layout", - "children": [{ - "instance": "Wnd", - "children": [], - // "children": [{ - // "instance": "Tab", - // "children": [] - // }] - }] + "children": [{"instance": "Wnd", "children": [{"instance": "Tab", "children": []}]}] }, { "direction": "tb", "size": "0px", diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index fd193793e..b712f0871 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -1056,9 +1056,10 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { let dragoverElement: Element; let disabledPosition: string; editorElement.addEventListener("dragover", (event: DragEvent & { target: HTMLElement }) => { - if (protyle.disabled) { + if (protyle.disabled || event.dataTransfer.types.includes(Constants.SIYUAN_DROP_EDITOR)) { event.preventDefault(); event.stopPropagation(); + event.dataTransfer.dropEffect = "none"; return; } const contentRect = protyle.contentElement.getBoundingClientRect();