Skip to content

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

:art: Disable drag in read-only mode of the editor (#15206)

Jeffrey Chen65c7be8dea17
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index f668b3c73c..185bdc399e 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;