Deselect all auto removed groups in drag & drop operations.

This fixes strange corner case that causes enabling
the grouping button when no visible shape is selected.
This commit is contained in:
Andrey Antukh 2017-03-10 12:49:26 +01:00
parent cc0b61f122
commit 57e98487e1
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
3 changed files with 111 additions and 97 deletions

View file

@ -154,7 +154,8 @@
[state {:keys [group] :as shape}]
(if-let [group' (get-in state [:shapes group])]
(if (empty? (:items group'))
(dissoc-shape state group')
(-> (dissoc-shape state group')
(update-in [:workspace :selected] disj (:id group')))
state)
state))

View file

@ -84,7 +84,8 @@
:path i/curve
:rect i/box
:text i/text
:group i/folder))
:group i/folder
nil))
;; --- Shape Name (Component)