From 65c7be8dea179b540b6766fe4e3a7eab9f560d89 Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Thu, 3 Jul 2025 10:11:03 +0800 Subject: [PATCH] :art: Disable drag in read-only mode of the editor (#15206) --- app/src/protyle/util/editorCommonEvent.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index f668b3c73..185bdc399 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -809,6 +809,11 @@ const dragSame = async (protyle: IProtyle, sourceElements: Element[], targetElem export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { editorElement.addEventListener("dragstart", (event) => { + if (protyle.disabled) { + event.preventDefault(); + event.stopPropagation(); + return; + } let target = event.target as HTMLElement; if (target.classList.contains("av__gallery-img")) { target = hasClosestByClassName(target, "av__gallery-item") as HTMLElement;