🐛 Fix problem with layout child properties

This commit is contained in:
alonso.torres 2024-02-21 15:58:47 +01:00 committed by Andrey Antukh
parent 4fb1247045
commit 2942f28880
2 changed files with 16 additions and 15 deletions

View file

@ -94,7 +94,8 @@
:layout-item-max-w :layout-item-max-w :layout-item-max-w :layout-item-max-w
:layout-item-min-w :layout-item-min-w :layout-item-min-w :layout-item-min-w
:layout-item-absolute :layout-item-absolute :layout-item-absolute :layout-item-absolute
:layout-item-z-index :layout-item-z-index}) :layout-item-z-index :layout-item-z-index
:layout-item-align-self :layout-item-align-self})
(def swap-keep-attrs (def swap-keep-attrs
#{:layout-item-margin #{:layout-item-margin
@ -106,7 +107,8 @@
:layout-item-max-w :layout-item-max-w
:layout-item-min-w :layout-item-min-w
:layout-item-absolute :layout-item-absolute
:layout-item-z-index}) :layout-item-z-index
:layout-item-align-self})
(defn instance-root? (defn instance-root?
"Check if this shape is the head of a top instance." "Check if this shape is the head of a top instance."

View file

@ -1445,9 +1445,8 @@
(defn- update-flex-child-copy-attrs (defn- update-flex-child-copy-attrs
"Synchronizes the attributes inside the flex-child items (main->copy)" "Synchronizes the attributes inside the flex-child items (main->copy)"
[changes _shape-main shape-copy main-container main-component copy-container omit-touched?] [changes _shape-main shape-copy main-container main-component copy-container omit-touched?]
(let [do-changes (let [new-changes
(fn [cc] (-> (pcb/empty-changes)
(-> cc
(pcb/with-container copy-container) (pcb/with-container copy-container)
(pcb/with-objects (:objects copy-container)) (pcb/with-objects (:objects copy-container))
(pcb/update-shapes (pcb/update-shapes
@ -1456,8 +1455,8 @@
(let [child-main (ctf/get-ref-shape main-container main-component child-copy)] (let [child-main (ctf/get-ref-shape main-container main-component child-copy)]
(-> child-copy (-> child-copy
(propagate-attrs child-main ctk/swap-keep-attrs omit-touched?)))) (propagate-attrs child-main ctk/swap-keep-attrs omit-touched?))))
{:ignore-touched true})))] {:ignore-touched true}))]
(pcb/concat-changes changes (do-changes (pcb/empty-changes))))) (pcb/concat-changes changes new-changes)))
(defn- update-flex-child-main-attrs (defn- update-flex-child-main-attrs
"Synchronizes the attributes inside the flex-child items (copy->main)" "Synchronizes the attributes inside the flex-child items (copy->main)"