Ver Fonte

:art: fix https://github.com/siyuan-note/siyuan/issues/6373

Vanessa há 2 anos atrás
pai
commit
c2c7bfdfb7
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      app/src/protyle/wysiwyg/index.ts

+ 3 - 1
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();