From 32b0fd7b3691d75688c29b0cadc5674c7b5ce600 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 4 Feb 2021 14:23:26 +0100 Subject: [PATCH] :bug: Fixes issue with multiple selection and shadows --- .../src/app/main/ui/workspace/sidebar/options/blur.cljs | 7 ++++++- .../app/main/ui/workspace/sidebar/options/multiple.cljs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/blur.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/blur.cljs index 58566a00c..cd1463807 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/blur.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/blur.cljs @@ -47,7 +47,12 @@ handle-change (fn [value] - (change! #(assoc-in % [:blur :value] value))) + (change! #(cond-> % + (not (contains? % :blur)) + (assoc :blur (create-blur)) + + :always + (assoc-in [:blur :value] value)))) handle-toggle-visibility (fn [] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs index ec223fcc5..3c7d587cd 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs @@ -123,6 +123,9 @@ [v] (when v (select-keys v blur-keys))) +(defn empty-map [keys] + (into {} (map #(hash-map % nil)) keys)) + (defn get-attrs "Given a `type` of options that we want to extract and the shapes to extract them from returns a list of tuples [id, values] with the extracted properties for the shapes that @@ -142,7 +145,9 @@ result (case props :ignore [ids values] :shape [(conj ids id) - (merge-attrs values (select-keys shape attrs))] + (merge-attrs values (merge + (empty-map attrs) + (select-keys shape attrs)))] :text [(conj ids id) (-> values (merge-attrs (select-keys shape attrs))