From 6cffaafe24b928e9a40397015e66b69db332e739 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 30 Apr 2020 13:52:46 +0200 Subject: [PATCH] :bug: Start edition mode on adding text shape. --- frontend/src/uxbox/main/data/workspace.cljs | 6 +++++- frontend/src/uxbox/main/ui/workspace/viewport.cljs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 9946e71a3..255b0487f 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -394,6 +394,8 @@ (recur (inc counter)) candidate))))) +(declare start-edition-mode) + (defn add-shape [attrs] (us/verify ::shape-attrs attrs) @@ -430,7 +432,9 @@ :id id}] (rx/of (dwc/commit-changes [rchange] [uchange] {:commit-local? true}) - (select-shapes #{id})))))) + (select-shapes #{id}) + (when (= :text (:type attrs)) + (start-edition-mode id))))))) ;; --- Duplicate Shapes diff --git a/frontend/src/uxbox/main/ui/workspace/viewport.cljs b/frontend/src/uxbox/main/ui/workspace/viewport.cljs index d2935fef8..122e571cf 100644 --- a/frontend/src/uxbox/main/ui/workspace/viewport.cljs +++ b/frontend/src/uxbox/main/ui/workspace/viewport.cljs @@ -141,7 +141,7 @@ on-mouse-down (mf/use-callback - (mf/deps drawing-tool) + (mf/deps drawing-tool edition) (fn [event] (dom/stop-propagation event) (let [ctrl? (kbd/ctrl? event)