From c2c7bfdfb74b86d62a883f25b429881e5fcb3504 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 27 Oct 2022 23:10:29 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/6373 --- app/src/protyle/wysiwyg/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 9c2729a9a..14113a331 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -190,6 +190,7 @@ export class WYSIWYG { private bindCommonEvent(protyle: IProtyle) { this.element.addEventListener("copy", (event: ClipboardEvent & { target: HTMLElement }) => { + window.siyuan.ctrlIsPressed = false; // https://github.com/siyuan-note/siyuan/issues/6373 // https://github.com/siyuan-note/siyuan/issues/4600 if (event.target.tagName === "PROTYLE-HTML") { event.stopPropagation(); @@ -197,7 +198,6 @@ export class WYSIWYG { } event.stopPropagation(); event.preventDefault(); - window.siyuan.ctrlIsPressed = false; // https://github.com/siyuan-note/siyuan/issues/6373 const range = getEditorRange(protyle.wysiwyg.element); const nodeElement = hasClosestBlock(range.startContainer); if (!nodeElement) { @@ -911,6 +911,7 @@ export class WYSIWYG { }); this.element.addEventListener("cut", (event: ClipboardEvent & { target: HTMLElement }) => { + window.siyuan.ctrlIsPressed = false; // https://github.com/siyuan-note/siyuan/issues/6373 if (event.target.tagName === "PROTYLE-HTML") { event.stopPropagation(); return; @@ -1265,6 +1266,7 @@ export class WYSIWYG { }); this.element.addEventListener("paste", (event: ClipboardEvent & { target: HTMLElement }) => { + window.siyuan.ctrlIsPressed = false; // https://github.com/siyuan-note/siyuan/issues/6373 // https://github.com/siyuan-note/siyuan/issues/4600 if (event.target.tagName === "PROTYLE-HTML") { event.stopPropagation();