From b40ea3fb2ad8970ef105b8722c9f7c51b0f9d8a4 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Wed, 25 Jan 2023 17:46:26 +0100 Subject: [PATCH] :bug: Fix multiuser - "Shadow" element is not updating immediately --- CHANGES.md | 1 + .../main/ui/workspace/sidebar/options/menus/shadow.cljs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 99816a27b..f6cbaf41d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -63,6 +63,7 @@ - Fix ctrl+c for inspect code [Taiga #4739](https://tree.taiga.io/project/penpot/issue/4739) - Fix text in custom font is not at the expected position at export [Taiga #4394](https://tree.taiga.io/project/penpot/issue/4394) - Fix unneeded popup when updating local components [Taiga #4430](https://tree.taiga.io/project/penpot/issue/4430) +- Fix multiuser - "Shadow" element is not updating immediately [Taiga #4709](https://tree.taiga.io/project/penpot/issue/4709) ### :heart: Community contributions by (Thank you!) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/shadow.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/shadow.cljs index 31e8b8a47..fca3df79e 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/shadow.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/shadow.cljs @@ -49,6 +49,8 @@ adv-blur-ref (mf/use-ref nil) adv-spread-ref (mf/use-ref nil) + shadow-style (str (:style value)) + remove-shadow-by-index (fn [values index] (->> (d/enumerate values) (filterv (fn [[idx _]] (not= idx index))) @@ -116,12 +118,12 @@ ;; :value (:blur value)}] [:select.input-select - {:default-value (str (:style value)) + {:default-value shadow-style :on-change (fn [event] (let [value (-> event dom/get-target dom/get-value d/read-string)] (st/emit! (dch/update-shapes ids #(assoc-in % [:shadow index :style] value)))))} - [:option {:value ":drop-shadow"} (tr "workspace.options.shadow-options.drop-shadow")] - [:option {:value ":inner-shadow"} (tr "workspace.options.shadow-options.inner-shadow")]] + [:option {:value ":drop-shadow" :selected (when (= shadow-style ":drop-shadow") "selected")} (tr "workspace.options.shadow-options.drop-shadow")] + [:option {:value ":inner-shadow" :selected (when (= shadow-style ":inner-shadow") "selected")} (tr "workspace.options.shadow-options.inner-shadow")]] [:div.element-set-actions [:div.element-set-actions-button {:on-click (toggle-visibility index)}