소스 검색

:art: https://github.com/siyuan-note/siyuan/issues/12989

V 7 달 전
부모
커밋
c93b0f6ace
2개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 4
      app/src/boot/globalEvent/keydown.ts
  2. 1 1
      app/src/protyle/wysiwyg/keydown.ts

+ 5 - 4
app/src/boot/globalEvent/keydown.ts

@@ -1371,6 +1371,11 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
             return;
         }
 
+        // 闪卡长按 Esc 光标定位到闪卡按钮上 https://github.com/siyuan-note/siyuan/issues/12989
+        if (document.activeElement && hasClosestByClassName(document.activeElement, "card__action")) {
+            return;
+        }
+
         if (window.siyuan.dialogs.length > 0) {
             window.siyuan.dialogs[window.siyuan.dialogs.length - 1].destroy();
             return;
@@ -1404,10 +1409,6 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
             return;
         }
 
-        // 闪卡长按 Esc 光标定位到闪卡按钮上 https://github.com/siyuan-note/siyuan/issues/12989
-        if (document.activeElement && hasClosestByClassName(document.activeElement, "card__action")) {
-            return;
-        }
         // 光标在文档树等面板中,按 Esc 回到编辑器中 https://github.com/siyuan-note/siyuan/issues/4289
         if (getSelection().rangeCount > 0) {
             const range = getSelection().getRangeAt(0);

+ 1 - 1
app/src/protyle/wysiwyg/keydown.ts

@@ -1180,7 +1180,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 // https://github.com/siyuan-note/siyuan/issues/12989
                 const cardElement = hasClosestByClassName(range.startContainer, "card__main", true);
                 if (cardElement && document.activeElement && document.activeElement.classList.contains("protyle-wysiwyg")) {
-                    (cardElement.querySelector(".card__action:not(.fn__none) button") as HTMLElement).focus();
+                    (cardElement.querySelector(".card__action:not(.fn__none) button:not([disabled])") as HTMLElement).focus();
                     hideElements(["select"], protyle);
                 }
             } else {