I play with a re-frame .
In the code below, I am having problems updating the input value when the user enters something into:
(defn measurement-input [{:keys [amount unit path]}] (let [amt (atom amount)] (fn [] [:div [:input {:type "text" :value @amt :on-change
The input value will not change until I change :value to :defaultValue . I am sure that the above example closely reflects the Reagent input example.
In the code below, I try to do two things when the user updates the input value. I'm trying to reset! enter a value, as well as dispatch value for the event handler. I wrapped both of these function calls in a do call.
It should also be noted that in the code below, the user can update the value in the text box.
(defn measurement-input [{:keys [amount unit path]}] (let [amt (atom amount)] (fn [] [:div [:input {:type "text" :value @amt :on-change (do
The following error appears in the javascript console:
Uncaught TypeError: Cannot read property 'call' of null template.cljs?rel=1435381284083:101
Any help is appreciated by everyone!
source share