0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 06:58:58 -05:00

🐛 Fix problem with align-self in grid

This commit is contained in:
alonso.torres 2023-12-04 13:12:28 +01:00 committed by Andrey Antukh
parent 203f36e064
commit 4f6b21c41c

View file

@ -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