Default values with MUI switch/radio group #274
Replies: 2 comments 3 replies
-
Yes.
<FormControl>
<FormLabel id="demo-radio-buttons-group-label">Gender</FormLabel>
<RadioGroup
{...conform.input(fields.option)}
>
<FormControlLabel value="female" control={<Radio />} label="Female" />
<FormControlLabel value="male" control={<Radio />} label="Male" />
<FormControlLabel value="other" control={<Radio />} label="Other" />
</RadioGroup>
</FormControl> |
Beta Was this translation helpful? Give feedback.
-
I think you ran into this bug I just filed: I assume your
Thank you! This is exactly what I needed for a quick workaround. |
Beta Was this translation helpful? Give feedback.
-
The example seems pretty far off from the rest of the guides on the conform docs. https://conform.guide/examples/material-ui
There's no props like
name={field.name}
or<Input {...conform.input(fieldConfig, {type: 'text'})} />
etc... I'd be happy to submit a PR to update the docs with the guidance in the answer to this question.I'm trying to make a form with default values and I'm having trouble getting them to show up.
And it's not setting the default values that I'm providing to the form
I've verified that the
user
passed intodefaultValue
is what I expect it to be, but neither of the radio buttons are checked when I render the page. It's also giving me console errors:conform.input
with material-ui?conform.collection
with MUI?{...props}
to, the<Radio />
or the<FormControlLabel />
?Beta Was this translation helpful? Give feedback.
All reactions