diff --git a/CHANGES.md b/CHANGES.md index e7d05cb56..5a2145b54 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -45,6 +45,7 @@ - Fix open overlay relative to a frame [Taiga #7563](https://tree.taiga.io/project/penpot/issue/7563) - Workspace-palette items stay hidden when opening with keyboard-shortcut [Taiga #7489](https://tree.taiga.io/project/penpot/issue/7489) - Fix SVG attrs are not handled correctly when exporting/importing in .zip [Taiga #7920](https://tree.taiga.io/project/penpot/issue/7920) +- Fix validation error when detaching with two nested copies and a swap [Taiga #8095](https://tree.taiga.io/project/penpot/issue/8095) ## 2.0.3 diff --git a/common/src/app/common/logic/libraries.cljc b/common/src/app/common/logic/libraries.cljc index ec40277e0..314970805 100644 --- a/common/src/app/common/logic/libraries.cljc +++ b/common/src/app/common/logic/libraries.cljc @@ -269,8 +269,8 @@ ; First level subinstances of a detached component can't have swap-slot (pcb/update-shapes [shape-id] ctk/remove-swap-slot) - :always - ; Near shape-refs need to be advanced one level + (nil? (ctk/get-swap-slot shape)) + ; Near shape-refs need to be advanced one level (except if the head is already swapped) (generate-advance-nesting-level nil container libraries (:id shape))) ;; Otherwise, detach the shape and all children