Radio button adding unwanted height/width
See original GitHub issueWhen using a radio button, it adds weird margins/padding to the radio buttons, and makes the text next to it appear not aligned.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
The text with the radio buttons to be aligned.
Current Behavior
Steps to Reproduce (for bugs)
<Grid container direction="row">
<Grid item>
Transmit to Supplier?
</Grid>
<Grid item>
<Grid container direction="row">
<Grid item>
<Radio
color="primary"
checked={shouldTransmitToSupplier === "yes"}
onChange={_handleChange}
value="yes"
/>
</Grid>
<Grid item>
Yes
</Grid>
<Grid item>
<Radio
color="primary"
checked={shouldTransmitToSupplier === "no"}
onChange={_handleChange}
value="no"
/>
</Grid>
<Grid item>
No
</Grid>
</Grid>
</Grid>
</Grid>
Here is an example using FormControl
<FormControl>
<Grid container direction="row">
<Grid item>
<FormLabel>
Transmit to Supplier?
</FormLabel>
</Grid>
<Grid item>
<RadioGroup
value={shouldTransmitToSupplier}
onChange={_handleChange}
row
>
<FormControlLabel
value="yes"
control={<Radio color="primary"/>}
label="Yes"
/>
<FormControlLabel
value="no"
control={<Radio color="primary"/>}
label="No"
/>
</RadioGroup>
</Grid>
</Grid>
</FormControl>
Except this one shows up like this:
Context
Your Environment
Tech | Version |
---|---|
Material-UI | 1.0.0-beta.38 |
React | 16.2 |
browser | latest Chrome on MacOS High Sierra |
etc |
Sandbox: https://codesandbox.io/s/zwq4w5pv2p => see demo.js
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Radio button adding unwanted height/width #10803 - GitHub
When using a radio button, it adds weird margins/padding to the radio buttons, and makes the text next to it appear not aligned....
Read more >How to change the size of the radio button using CSS?
The idea is to use the appearance property, which when set to none allows to change the width and height of the radio...
Read more >How can I change the size of the radio button input? - Jotform
As mentioned in the original thread, the radio button used a standard user agent stylesheets so they cannot be changed. A workaround would...
Read more >Styling a radio button with only CSS
CSS Style Radio Button Styling a radio button with only CSS ... our otherwise inline radio button able to have a consistent width...
Read more >Pure CSS Custom Styled Radio Buttons
Learn to create custom, cross-browser, theme-able, scalable radio buttons in pure CSS and ensuring styles remain accessible across states.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@oliviertassinari Sandbox up! https://codesandbox.io/s/zwq4w5pv2p
Yeah, idk why alignItems i am struggling and keep forgetting to use it 😦 Thanks for the help