mirror of
https://github.com/penpot/penpot.git
synced 2025-03-15 09:11:21 -05:00
🐛 Component layers are incorrectly relocated on drag'n'drop
This commit is contained in:
parent
1c38883ddd
commit
55293e60d6
1 changed files with 20 additions and 17 deletions
|
@ -262,6 +262,9 @@
|
|||
(mf/use-fn
|
||||
(mf/deps id index objects expanded? selected)
|
||||
(fn [side _data]
|
||||
(let [single? (= (count selected) 1)
|
||||
same? (and single? (= (first selected) id))]
|
||||
(when-not same?
|
||||
(let [shape (get objects id)
|
||||
|
||||
parent-id
|
||||
|
@ -284,7 +287,7 @@
|
|||
(and expanded? (= side :bot) (d/not-empty? (:shapes shape))) (count (:shapes parent))
|
||||
(= side :top) (inc index)
|
||||
:else index)]
|
||||
(st/emit! (dw/relocate-selected-shapes parent-id to-index)))))
|
||||
(st/emit! (dw/relocate-selected-shapes parent-id to-index)))))))
|
||||
|
||||
on-hold
|
||||
(mf/use-fn
|
||||
|
|
Loading…
Add table
Reference in a new issue