From 537c5ca7b83591c0f9e4523a40a8ca126a4c7e71 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 12 Aug 2025 17:56:03 +0200 Subject: [PATCH] :bug: Fix missing selection after swap (#7104) --- .../src/app/main/data/workspace/libraries.cljs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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"