Fork me on GitHub

@kenny Using on-input works for me, why isn't it considered a valid handler? If you're worried about browser compatibility, there's a table here: Can't look into this anymore right now, but I'll come back to it. The workaround @gws provided is reasonable.


strange that React prefers onChange to onInput, context in this thread (complaints at the bottom): - I can't find any reference to it in the docs, though.


This is my code. I'm using a reagent sandbox project I have, so maybe I should make a new one. Testing in chrome. Not receiving a warning, and it's behaving as a number input without any js at all.

(defonce input-state (r/atom 0))

(defn hello []
  [:input {:type "number"
           :value @input-state
           :on-input (fn [evt]
                        (let [val (.. evt -target -value)]
                          (reset! input-state val)))}])


that combination did the trick for me, too. you're absolutely right.


anyway this issue has been haunting me as well, so thanks