mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 08:41:39 +02:00
🐛 Fix issue with paste ordering sometimes not being respected
This commit is contained in:
parent
a8103cbc3e
commit
9923268589
2 changed files with 6 additions and 6 deletions
|
@ -1482,12 +1482,11 @@
|
|||
(let [set-index (fn [[result index] id]
|
||||
[(assoc result id index) (inc index)])
|
||||
|
||||
map-ids (when index
|
||||
(->> (vals paste-objects)
|
||||
(filter #(not (selected (:parent-id %))))
|
||||
(map :id)
|
||||
(reduce set-index [{} (inc index)])
|
||||
first))]
|
||||
map-ids
|
||||
(->> selected
|
||||
(map #(get-in paste-objects [% :id]))
|
||||
(reduce set-index [{} (inc index)])
|
||||
first)]
|
||||
(if (and (= :add-obj (:type change))
|
||||
(contains? map-ids (:old-id change)))
|
||||
(assoc change :index (get map-ids (:old-id change)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue