From b25806b1725944a8edbf4a0d79ea405fad1372ac Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 25 May 2022 21:43:50 +0200 Subject: [PATCH] :bug: Fix problem with auto-width initial text --- frontend/src/app/main/data/workspace/texts.cljs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index 6789fe0195..956c41c599 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -63,13 +63,17 @@ (ted/get-editor-current-content))] (if (ted/content-has-text? content) (let [content (d/merge (ted/export-content content) - (dissoc (:content shape) :children))] + (dissoc (:content shape) :children)) + modifiers (get-in state [:workspace-text-modifier id])] (rx/merge (rx/of (update-editor-state shape nil)) (when (and (not= content (:content shape)) (some? (:current-page-id state))) (rx/of - (dch/update-shapes [id] #(assoc % :content content)) + (dch/update-shapes [id] (fn [shape] + (-> shape + (assoc :content content) + (merge modifiers)))) (dwu/commit-undo-transaction))))) (when (some? id)