From 4f6b21c41c1797ab60d72f23c1923498cdda12b8 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 4 Dec 2023 13:12:28 +0100 Subject: [PATCH] :bug: Fix problem with align-self in grid --- .../workspace/sidebar/options/menus/grid_cell.cljs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/grid_cell.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/grid_cell.cljs index e19f46c1b..3b351c13a 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/grid_cell.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/grid_cell.cljs @@ -41,12 +41,18 @@ (let [new-css-system (mf/use-ctx ctx/new-css-system) dir-v [:auto :start :center :end :stretch #_:baseline] alignment (or alignment :auto) - type (if is-col? "col" "row")] + type (if is-col? "col" "row") + + handle-set-alignment + (mf/use-callback + (mf/deps set-alignment) + (fn [value] + (set-alignment (-> value keyword))))] (if new-css-system [:div {:class (stl/css :self-align-menu)} [:& radio-buttons {:selected (d/name alignment) - :on-change #(set-alignment (keyword %)) + :on-change handle-set-alignment :name (dm/str "flex-align-items-" type)} [:& radio-button {:value "start" :icon (if is-col? i/align-self-row-left-refactor i/align-self-column-top-refactor) @@ -93,7 +99,7 @@ cell (or cell (attrs/get-attrs-multi cells cell-props)) multiple? (= :multiple (:id cell)) - cell-ids (if (some? cell) [(:id cell)] (->> cells (map :id))) + cell-ids (if multiple? (->> cells (map :id)) [(:id cell)]) cell-ids (hooks/use-equal-memo cell-ids) {:keys [position area-name align-self justify-self column column-span row row-span]} cell