🐛 Fix problem when drag+duplicate a full grid

This commit is contained in:
alonso.torres
2025-11-26 15:15:00 +01:00
committed by Andrey Antukh
parent b5a6867058
commit 6611fbd13b
2 changed files with 9 additions and 5 deletions

View File

@@ -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)

View File

@@ -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)