Merge pull request #2247 from penpot/palba-select-children-on-ungrouping

🐛 Fix when ungrouping, the items previously grouped should ALWAYS…
This commit is contained in:
Alejandro 2022-09-12 08:27:14 +02:00 committed by GitHub
commit f98512242a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -154,18 +154,24 @@
is-group? #(or (= :bool (:type %)) (= :group (:type %)))
lookup #(get objects %)
prepare #(prepare-remove-group it page-id % objects)
selected (wsh/lookup-selected state)
children (into (d/ordered-set)
(mapcat #(->> %
lookup
:shapes) selected))
changes-list (sequence
(comp (map lookup)
(filter is-group?)
(map prepare))
(wsh/lookup-selected state))
(comp (map lookup)
(filter is-group?)
(map prepare))
selected)
changes {:redo-changes (vec (mapcat :redo-changes changes-list))
:undo-changes (vec (mapcat :undo-changes changes-list))
:origin it}]
(rx/of (dch/commit-changes changes))))))
(rx/of (dch/commit-changes changes)
(dws/select-shapes children))))))
(def mask-group
(ptk/reify ::mask-group