diff --git a/src/utils/hotkeys.ts b/src/utils/hotkeys.ts index 8e4c48d..4a99a61 100644 --- a/src/utils/hotkeys.ts +++ b/src/utils/hotkeys.ts @@ -18,8 +18,6 @@ window.onkeydown = function (e) { // console.log(key); if (listeners == null || listeners.length === 0) return; - e.stopPropagation(); - e.preventDefault(); // 异或操作. const xor = (a: boolean, b: boolean) => a !== b; @@ -30,6 +28,8 @@ window.onkeydown = function (e) { if (xor(shift, e.shiftKey)) return; if (xor(alt, e.altKey)) return; + e.stopPropagation(); + e.preventDefault(); callback(); }); };