New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React 15.6.0 + Redux-form has broken radio buttons #3087
Comments
Experiencing exactly the same issue here. @tstirrat15, make sure that you're using the same |
I experienced the same issues as well. Sandbox Linkhttps://codesandbox.io/s/G6zR5o3P8 The radio buttons can be selected but the onChange event handler only fires once for each radio button. |
I've got the same issue with |
JavaScript Jenga! Add a +1 to the list of 15.5.4 did the trick |
Experiencing this also, rolling back is not an option for us. :( |
Any updates on this? |
Just update to the latest redux-form, it works fine on 7.0.3. It should have been fixed somehow. |
As you can see in https://codesandbox.io/s/G6zR5o3P8, it hasn't been fixed. |
Same issue, roll back to 15.5.4 now |
Rolling back |
It must be caused by the |
It's probably the interaction with the React changes, but I've also tracked it down to the fix for #2444 If i comment out the fix fro that issue in ConnectedField.js, then things seem to work for me. |
actually, that's not quite right - if I comment out those lines, my UI state changes, but the onChange event is still not fired for the input and the value doesn't change.. However, if I get rid of the onBlur event handler entirely from the constructed react component (comment out line 245), then things work. |
Here's a forked version of @lothisoft's sandbox. It was broken with |
Hello I'm using react 15.6.1 and I still have this issue |
You are correct. It is not fixed in 15.6.1. Apologies. Reopening. |
As a workaround, I used onClick instead of onChange in my < input />. What do you think ? |
Okay, this seems to be an implementation problem. On @lothisoft's sandbox, he is not passing a checked={radioButtonValue === field.input.value} This is what
*Granted, this isn't documented very well. Perhaps something about this should go into the Does this make sense to everyone? If not, please ask questions. |
@erikras your "real solution" is not working now |
@erikras example solution does not produce value |
news? |
use final-form? |
I thought I was having this issue, then I realized all html inputs were receiving the same id and, thus, all labels were being associated with the first radio button. Now it's working fine for me. Just let |
Just wasted 1 hour on this: if you pass a number as value, it is not automatically converted to string and it breaks the behavior of the input radio. (The value is correctly set in the reduxform store, but the input never appears selected) So you need to convert it to string by yourself:
Note that passing a number as value to a React input radio works. I guess that's what confused me. Hope it can help! |
For me the problem was with BrowserSync configuration (wasted 1.5 hours figuring it out). |
For me, my issue was the Field name prop didn't match up. I thought they had to be different.. they have to be same for your radios to work. |
Or alternatively to the great solution by @ggregoire the input value may be parsed as a number: <Field
name="user"
component="input"
type="radio"
value={user.id}
parse={Number}
/> |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
1 similar comment
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What is the current behavior?
A component that demonstrates it:
Package.json versions:
I've verified that redux-form version doesn't matter, and that
15.5.4
works but15.6.0
doesn't for react. Perhaps it's related to facebook/react#8575 ?What happens in the broken case is that the
blur
andfocus
events fire, but thechange
event never fires. I'm not familiar enough with either the React or Redux-form internals to understand what isn't working.This behavior could have been what was seen in #2526 as well.
What is the expected behavior?
Being able to select the radio button
Sandbox Link
https://codesandbox.io/s/M8lXj4vRR
Oddly, I wasn't able to reproduce this in the sandbox. Is there something about Babel or Webpack that could be screwing things up?
What's your environment?
Browsers: both firefox and chrome
Redux-form version: 6.8.0
React version: 15.6.0
Babel core version: 6.17.0
Webpack version: 2.3.3
Node version: 6.7.0
Other information
I'm kind of at a loss for what other information could be pertinent/useful. In the meantime we'll downgrade to React 15.5.4 and keep running, but this struck me as very odd.
The text was updated successfully, but these errors were encountered: