day8 / re-com

A ClojureScript library of reusable components for Reagent
https://re-com.day8.com.au
MIT License
797 stars 146 forks source link

radio-button on-change handler doesn't receive value argument #137

Closed p-himik closed 7 years ago

p-himik commented 7 years ago

:on-change argument description: "called when the radio button is clicked. Passed :value". Actual code:

callback-fn #(when (and on-change (not disabled?))
               (on-change (not model)))  ;; call on-change with either true or false
p-himik commented 7 years ago

The problem with fixing it in the main repo is that replacing (not model) with value is definitely a breaking change. And fixing :on-change description is also not that simple because value can be false - in this case clicking on such radio button that has its model set to nil will result in (on-change true) and not in (on-change false), which would be expected because of the description of :value.

Gregg8 commented 7 years ago

Nice catch. It appears this bug has been there for over two years so it's interesting it hasn't been mentioned until now.

And yes, it's a breaking change but it's breaking back to what it originally was and should be. So we'll fix it and bump the major version.