From 4606785e5f7203507186bfccc32cf344fd453b63 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 15 Mar 2024 13:33:32 +0100 Subject: [PATCH] :bug: Fix move anidated structures withc component copies to other component copies --- frontend/src/app/main/data/workspace/transforms.cljs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index 10515ac9c5..15622d4dda 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -905,6 +905,11 @@ moving-shapes-ids (map :id moving-shapes) + moving-shapes-children-ids + (->> moving-shapes + (mapcat #(cfh/get-children-with-self objects (:id %))) + (map :id)) + changes (-> (pcb/empty-changes it page-id) (pcb/with-objects objects) @@ -913,7 +918,7 @@ (pcb/update-shapes moving-shapes-ids ctl/remove-layout-item-data)) ;; Remove component-root property when moving a shape inside a component (cond-> (ctn/get-instance-root objects frame) - (pcb/update-shapes moving-shapes-ids #(dissoc % :component-root))) + (pcb/update-shapes moving-shapes-children-ids #(dissoc % :component-root))) ;; Add component-root property when moving a component outside a component (cond-> (not (ctn/get-instance-root objects frame)) (pcb/update-shapes moving-shapes-ids (fn [shape]