From a02f94e5c1633da38a30a1c3594eca9d2047d497 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Wed, 17 Apr 2024 18:57:27 +0800 Subject: [PATCH] fix: some shortcuts not working on Chrome --- src/main/frontend/modules/shortcut/before.cljs | 2 ++ src/main/frontend/modules/shortcut/config.cljs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/modules/shortcut/before.cljs b/src/main/frontend/modules/shortcut/before.cljs index 83b45c77e..020d7604f 100644 --- a/src/main/frontend/modules/shortcut/before.cljs +++ b/src/main/frontend/modules/shortcut/before.cljs @@ -10,6 +10,7 @@ (f e) ;; return false to prevent default browser behavior ;; and stop event from bubbling + (.preventDefault e) false)) (defn enable-when-not-editing-mode! @@ -18,6 +19,7 @@ (when-not (or (state/editing?) (util/input? (.-target e))) (f e) + (.preventDefault e) false))) (defn enable-when-editing-mode! diff --git a/src/main/frontend/modules/shortcut/config.cljs b/src/main/frontend/modules/shortcut/config.cljs index e4a5b1a97..dc3be0142 100644 --- a/src/main/frontend/modules/shortcut/config.cljs +++ b/src/main/frontend/modules/shortcut/config.cljs @@ -353,7 +353,7 @@ :editor/select-parent {:binding "mod+a" :fn editor-handler/select-parent} - :editor/zoom-in {:binding (if mac? "mod+." "alt+right") + :editor/zoom-in {:binding (if mac? ["mod+." "mod+shift+."] "alt+right") ; FIXME: mod+. not works on Chrome :fn editor-handler/zoom-in!} :editor/zoom-out {:binding (if mac? "mod+," "alt+left")