Open tmcdonnell87 opened 7 years ago
On react-redux-forms version 1.14.1 this is also happening for the native radio button.
@stevenmason can you whip up a quick CodePen example for that?
@davidkpiano You can easily test it in @tmcdonnell87 example by changing the react-redux-forms version to 1.14.1
I did notice that Control.radio
doesn't not support Number values too. It seems to support just String values. I think it would be good if it were at least explained in docs.
The Problem
When using native controls, it is possible to create a boolean-valued radio button, such as:
However, when you create the same button and pass in a component, the boolean value is translated to a string, and thus doesn't allow the button to be clicked.
Steps to Reproduce
See reproduced example. Note that, in the top section, clicking the
Boolean true
option does nothing, and theBoolean false
option matches theString false
option. In the bottom section, all radio buttons work as expected.Expected Behavior
Radio button behavior is consistent even when using custom controls.
Actual Behavior
Boolean values are converted to strings in state, and thus do not match the control value.
Reproducible Code Example
https://esnextb.in/?gist=98695ff117787fcdc4a3a10245cd0582