reagent-project / reagent-template

A Leiningen template for projects using Reagent.
MIT License
394 stars 55 forks source link

Range input onChange event doesn't fire at midpoint #169

Closed BrianLitwin closed 5 years ago

BrianLitwin commented 5 years ago

If you create this component:


[:input 
:type "range" 
:min 0 
:max 100 
:step 25 
:value 0 
:onInput #(prn "onInput") 
:onChange #(prn "onChange")}]

When the component first initializes, if you click on the components midpoint such that the value is 50, the onInput will fire but onChange will not, and the slider will move to the midpoint. After the first click, onChange fires as it should.

The use case where this arose was trying to update value on onChange, and value not updating if the user's first move after the component initialized was to click on the middle of the slider.