question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Radio button adding unwanted height/width

See original GitHub issue

When 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. image

Current Behavior

image

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: image

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:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mcrowder65commented, Mar 26, 2018
0reactions
mcrowder65commented, Mar 26, 2018

Yeah, idk why alignItems i am struggling and keep forgetting to use it 😦 Thanks for the help

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found