mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 00:58:26 -05:00
🐛 Fix detach components with shortcut
This commit is contained in:
parent
8ea4e5ca10
commit
10d6f93ed7
1 changed files with 4 additions and 2 deletions
|
@ -618,11 +618,13 @@
|
|||
(wsh/lookup-selected)
|
||||
(cfh/clean-loops objects))
|
||||
selected-objects (map #(get objects %) selected)
|
||||
can-detach? (every? #(not (ctn/has-any-copy-parent? objects %)) selected-objects)
|
||||
copies (filter ctk/in-component-copy? selected-objects)
|
||||
can-detach? (and (seq copies)
|
||||
(every? #(not (ctn/has-any-copy-parent? objects %)) selected-objects))
|
||||
changes (when can-detach?
|
||||
(reduce
|
||||
(fn [changes id]
|
||||
(dwlh/generate-detach-instance changes libraries container id))
|
||||
(dwlh/generate-detach-instance changes container libraries id))
|
||||
(-> (pcb/empty-changes it)
|
||||
(pcb/with-container container)
|
||||
(pcb/with-objects objects))
|
||||
|
|
Loading…
Add table
Reference in a new issue