فهرست منبع

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

Vanessa 8 ماه پیش
والد
کامیت
5e3d472edb
3فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 3 0
      app/src/boot/globalEvent/keydown.ts
  2. 1 0
      app/src/constants.ts
  3. 2 0
      app/src/dialog/confirmDialog.ts

+ 3 - 0
app/src/boot/globalEvent/keydown.ts

@@ -876,6 +876,9 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
     }
     if (event.key === "Delete" || (event.key === "Backspace" && isMac())) {
         window.siyuan.menus.menu.remove();
+        if (document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_CONFIRM}"]`)) {
+            return;
+        }
         deleteFiles(liElements);
         return true;
     }

+ 1 - 0
app/src/constants.ts

@@ -126,6 +126,7 @@ export abstract class Constants {
     public static readonly LOCAL_EMOJIS = "local-emojis";
 
     // dialog
+    public static readonly DIALOG_CONFIRM = "dialog-confirm";
     public static readonly DIALOG_OPENCARD = "dialog-opencard";
     public static readonly DIALOG_MAKECARD = "dialog-makecard";
     public static readonly DIALOG_VIEWCARDS = "dialog-viewcards";

+ 2 - 0
app/src/dialog/confirmDialog.ts

@@ -1,5 +1,6 @@
 import {isMobile} from "../util/functions";
 import {Dialog} from "./index";
+import {Constants} from "../constants";
 
 export const confirmDialog = (title: string, text: string,
                               confirm?: (dialog?: Dialog) => void,
@@ -33,4 +34,5 @@ export const confirmDialog = (title: string, text: string,
         }
         dialog.destroy();
     });
+    dialog.element.setAttribute("data-key", Constants.DIALOG_CONFIRM);
 };