diff --git a/CHANGES.md b/CHANGES.md index 44a4d950d3..9cbde15f9b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,8 @@ ### :bug: Bugs fixed +- Fix problem when drag+duplicate a full grid [Taiga #12565](https://tree.taiga.io/project/penpot/issue/12565) + ## 2.12.0 (Unreleased) diff --git a/common/src/app/common/logic/libraries.cljc b/common/src/app/common/logic/libraries.cljc index 3734774932..a2a8da1b9a 100644 --- a/common/src/app/common/logic/libraries.cljc +++ b/common/src/app/common/logic/libraries.cljc @@ -2815,13 +2815,15 @@ ids-map (into {} (map #(vector % (uuid/next))) all-ids) - ;; If there is an alt-duplication of a variant, change its parent to root - ;; so the copy is made as a child of root + ;; If there is an alt-duplication we change to root + ;; For variants so the copy is made as a child of root ;; This is because inside a variant-container can't be a copy + ;; For other shape this way the layout won't be changed when duplicated + ;; and if you move outside the layout will not change shapes (map (fn [shape] - (if (and alt-duplication? (ctk/is-variant? shape)) - (assoc shape :parent-id uuid/zero :frame-id nil) - shape)) + (cond-> shape + alt-duplication? + (assoc :parent-id uuid/zero :frame-id uuid/zero))) shapes)