diff --git a/frontend/src/app/main/data/workspace/groups.cljs b/frontend/src/app/main/data/workspace/groups.cljs index acdf92f462..056b9b9c7d 100644 --- a/frontend/src/app/main/data/workspace/groups.cljs +++ b/frontend/src/app/main/data/workspace/groups.cljs @@ -119,8 +119,11 @@ (watch [it state _] (let [page-id (:current-page-id state) objects (dsh/lookup-page-objects state page-id) + ids (d/nilv ids (dsh/lookup-selected state)) + ;; an unmasked group takes the bounds of all its children, which + ;; the layout it is in places again + parents (into #{} (keep #(:parent-id (get objects %))) ids) + changes (clg/generate-unmask-changes it page-id objects ids)] - changes (clg/generate-unmask-changes it page-id objects - (d/nilv ids (dsh/lookup-selected state)))] - - (rx/of (dch/commit-changes changes))))))) + (rx/of (dch/commit-changes changes) + (ptk/data-event :layout/update {:ids parents}))))))) diff --git a/frontend/test/frontend_tests/composable_tests/generated_test.cljs b/frontend/test/frontend_tests/composable_tests/generated_test.cljs index 6047f3a1f5..137cd40950 100644 --- a/frontend/test/frontend_tests/composable_tests/generated_test.cljs +++ b/frontend/test/frontend_tests/composable_tests/generated_test.cljs @@ -1102,3 +1102,10 @@ [:delete 8 0 0 0] [:swap 15 0 0 0] [:edit 14 0 0 0] [:resize 4 0 0 0] [:resize 0 0 0 0] [:nest 4 0 0 0] [:rotate 5 0 0 0] [:update-main 14 0 0 0] [:duplicate 0 0 0 0]]}))) + +(t/deftest ^:async generated-an-unmask-in-a-flex-main-places-the-group-again + ;; an unmasked group takes the bounds of all its children, which the flex + ;; it is in places again + (await (replay {:world [2 0 {:variants false :rich-variants false :text true :layout :flex + :layout-copies false :layout-children true}] + :ops [[:structure 11 1 13] [:structure 0 3]]})))