enhance: allow object to unset its class

also fixes an issue where invalid uuids options were selecting the first
option even though they weren't a match
pull/10438/head
Gabriel Horner 2023-08-28 18:07:08 -04:00
parent 16574ff3d0
commit d28d27b23e
1 changed files with 9 additions and 6 deletions

View File

@ -49,17 +49,20 @@
:value id
:selected (= class id)})
classes)
options' (if class
options
(cons
options' (cons
(if class
{:label "Choose a class"
:value ""}
{:label "Choose a class"
:disabled true
:selected true
:value ""}
options))]
:value ""})
options)]
(ui/select options'
(fn [_e value]
(swap! *property-schema assoc :class (uuid value))))))
(if (seq value)
(swap! *property-schema assoc :class (uuid value))
(swap! *property-schema dissoc :class))))))
(rum/defcs property-config <
rum/reactive