Material-ui: [RadioButtonGroup] Does not respond to defaultSelected changes

Created on 2 Feb 2015  路  2Comments  路  Source: mui-org/material-ui

I don't think this is specific to the RadioButtonGroup, but when using dynamic routes with react-router, I noticed that if I try to set the value of a RadioButtonGroup in the render method via the "defaultSelected" property, it doesn't update the component underneath.

I am able to change the component by calling setSelectedValue() on the RadioButtonGroup ref in my componentWillReceiveProps() method.

I'm guessing this is expected behavior, but I don't feel I fully understand why. So the property changes in the render method, but it was already drawn, and so it doesn't result in a dom update.

Are there more properties like this? Should it be documented or is there a clear logic behind it? I'm just trying to understand...

bug 馃悰

Most helpful comment

Seems that the defaultSelected option is not meant to be dynamically changed, event during component re-rendering.
I think you were looking for the valueSelected option

All 2 comments

@0x80 : Were you able to get a solution to this?

I am closing this issue for now as its really old and there has been no response again from your side so I an guessing that you were able to fix it.

If you still feel it issue exists or if its still not clear to you feel free to leave a comment below and we will try and help you.

Seems that the defaultSelected option is not meant to be dynamically changed, event during component re-rendering.
I think you were looking for the valueSelected option

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

finaiized picture finaiized  路  3Comments

revskill10 picture revskill10  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

chris-hinds picture chris-hinds  路  3Comments