From 16c4116c15a493671e00f1a786905ab8f44e9f08 Mon Sep 17 00:00:00 2001 From: eva Date: Wed, 5 Jan 2022 12:41:41 +0100 Subject: [PATCH] :bug: fix enter key as a way to exit path editing mode --- CHANGES.md | 1 + frontend/src/app/main/data/workspace.cljs | 2 +- frontend/src/app/main/data/workspace/path/shortcuts.cljs | 8 ++------ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4de8b1e04..ed14664e4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ ### :bug: Bugs fixed +- Fix Enter as key action to exit edit path [Taiga #2444](https://tree.taiga.io/project/penpot/issue/2444). - Fix add fill color from palette to groups and components [Taiga #2313](https://tree.taiga.io/project/penpot/issue/2313). - Fix default project name in all languages [Taiga #2280](https://tree.taiga.io/project/penpot/issue/2280). - Fix line-height and letter-spacing inputs to allow negative values [Taiga #2381](https://tree.taiga.io/project/penpot/issue/2381). diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 75e62dba1..41fb045ad 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -635,7 +635,7 @@ objects (wsh/lookup-page-objects state page-id) shapes (cp/select-toplevel-shapes objects {:include-frames? true}) srect (gsh/selection-rect shapes)] - (if (= 0 (count shapes)) + (if (empty? shapes) state (update state :workspace-local (fn [{:keys [vport] :as local}] diff --git a/frontend/src/app/main/data/workspace/path/shortcuts.cljs b/frontend/src/app/main/data/workspace/path/shortcuts.cljs index cb27407e1..a8c514a48 100644 --- a/frontend/src/app/main/data/workspace/path/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/path/shortcuts.cljs @@ -28,7 +28,7 @@ (get-in state [:workspace-local :edition])) path-edit-mode (get-in state [:workspace-local :edit-path edition-id :edit-mode])] (if-not (= :draw path-edit-mode) - (rx/of :interrupt (dw/deselect-all true)) + (rx/of :interrupt) (rx/empty)))))) (def shortcuts @@ -73,13 +73,9 @@ :fn #(st/emit! (drp/toggle-snap))} :escape {:tooltip (ds/esc) - :command "escape" + :command ["escape" "enter"] :fn #(st/emit! (esc-pressed))} - :start-editing {:tooltip (ds/enter) - :command "enter" - :fn #(st/emit! (dw/start-editing-selected))} - :undo {:tooltip (ds/meta "Z") :command (ds/c-mod "z") :fn #(st/emit! (drp/undo-path))}