redux-form-material-ui
redux-form-material-ui copied to clipboard
Radio buttons does not work with numeric values
When I pass numeric values to radio buttons, it does not work as expected. I have to to click two times on button to select it. E.g.:
<Field name="count" component={RadioButtonGroup}>
<RadioButton value={1} label="one" />
<RadioButton value={2} label="two" />
<RadioButton value={3} label="three" />
</Field>
After quick debugging I have found that when I click on the button first time, the type of value is string. After second click on the same radio button is the value numeric and button becomes selected.
However it works just fine with string values.
I'm seeing this too.. thanks for the workaround, using strings works for me 👍
Had this too. I was able to resolve it with
normalize={v => Number(v)} - not sure if this is the most ideal way though.
which MUI version you're using ?
Also, if it is MUI 1.0 and knows the fix would mind sending PR ?