diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index 82e9fd401e..c61dbb2570 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -988,12 +988,15 @@ (into parents-of-swapped) (conj (:id new-shape)))] - (rx/of - (dwu/start-undo-transaction undo-id) - (dch/commit-changes changes) - (dws/select-shape (:id new-shape) true) - (ptk/data-event :layout/update {:ids all-parents :undo-group undo-group}) - (dwu/commit-undo-transaction undo-id)))))) + (rx/merge + (rx/of + (dwu/start-undo-transaction undo-id) + (dch/commit-changes changes) + (ptk/data-event :layout/update {:ids all-parents :undo-group undo-group}) + (dwu/commit-undo-transaction undo-id) + (dws/deselect-all)) + (->> (rx/of (dws/select-shape (:id new-shape) false)) + (rx/delay 1))))))) (defn component-multi-swap "Swaps several components with another one"