I have the following code (from om.next
) creating a checkbox input. The creation works fine, but I don't know how to get the event value, as I don't see the value somewhere in the logs when I click on it (there is a lot of data though) :
(dom/input #js {:type "checkbox"
:onClick (fn [e] (js/console.log e)) ;; how do I get the current true/false value from `e` ?
})
I get in the logs (abbreviated) :
SyntheticMouseEvent {dispatchConfig: Object, dispatchMarker: ".0.0.1.$[cardpath]=1[om_tutorial=1B_UI_Exercises]=1[exercise-3].0.$-184795562.1.0", nativeEvent: MouseEvent, target: input, currentTarget: input…}
Note : the code is from there.
(.- target e)
returns you the element,
generally you want the .-value
from an element, but for a checkbox you want .-checked
instead... so something like
(.. e -target -checked)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With