diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index ec0045125..6789fe019 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -375,6 +375,15 @@ (update [_ state] (update-in state [:workspace-text-modifier id] (fnil merge {}) props)))) +(defn clean-text-modifier + [id] + (ptk/reify ::clean-text-modifier + ptk/WatchEvent + (watch [_ _ _] + (->> (rx/of #(update % :workspace-text-modifier dissoc id)) + ;; We delay a bit the change so there is no weird transition to the user + (rx/delay 50))))) + (defn remove-text-modifier [id] (ptk/reify ::remove-text-modifier diff --git a/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts.cljs b/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts.cljs index b8e726951..a02b70682 100644 --- a/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts.cljs @@ -68,7 +68,9 @@ ;; Update the position-data of every text fragment (let [position-data (utp/calc-position-data node)] - (st/emit! (dwt/update-position-data id position-data)))) + (st/emit! (dwt/update-position-data id position-data))) + + (st/emit! (dwt/clean-text-modifier id))) (defn- update-text-modifier [{:keys [grow-type id]} node]