-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
MUI radio widget initializes as uncontrolled when schema has no default value #3511
Comments
I believe the solution to this is to use |
@tyrdavis I tried your example and the same behavior occurs for |
…default value #3511 (#3532) * fix : default value for radio button group #3511 * updated changelog * Update CHANGELOG.md --------- Co-authored-by: Heath C <[email protected]>
Prerequisites
What theme are you using?
mui
Version
5.1.0
Current Behavior
When using the MUI theme, a field using
RadioWidget
with no default value renders as uncontrolled. In a non-production app, there is a MUI warning logged to the console, which unfortunately can't be seen in the playground. The widget being uncontrolled causes some strange behaviors, such as it no longer responding to programmatic changes to its value.Playground link with the issue
In the above playground, if you select one of the radio options, then attempt to use the programmatic reset button, the field does not reset its value due to it being uncontrolled. Compare to this playground link using the default theme and this playground link using MUI but with a default defined to see the widget working as expected.
Expected Behavior
MUI's
RadioGroup
should always be controlled when instantiated by RJSF to prevent unexpected behavior.Steps To Reproduce
RadioWidget
and nodefault
definedEnvironment
Anything else?
No response
The text was updated successfully, but these errors were encountered: