Skip to content
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

Add a block/fullWidth mode for FormControlLabel #11016

Closed
1 task done
dantman opened this issue Apr 13, 2018 · 8 comments
Closed
1 task done

Add a block/fullWidth mode for FormControlLabel #11016

dantman opened this issue Apr 13, 2018 · 8 comments
Labels
component: FormControl The React component

Comments

@dantman
Copy link
Contributor

dantman commented Apr 13, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior

Currently all of the labeled Checkbox/Radio buttons in the Selection Controls are "inline". i.e. They are defined as inline-block and even though FormGroup uses flex+column to stretch the Checkbox/Radio the FormControlLabel defines a margin-right: 16px;.

This means that in the block/list examples the right 16px of the list is not clickable and text also cannot span into this area even though the top FormLabel can.

Expected Behavior

FormControlLabel should have a mode that will disable the marginRight. We could re-use fullWidth and combine it with display: block; and apply width: 100%;.

@oliviertassinari
Copy link
Member

@dantman Do you have any specific implementation in mind? I guess we could replace the margin-right with a padding-right to expand the clickable area.

@dantman
Copy link
Contributor Author

dantman commented Apr 15, 2018

I believe the reason the margin-right exists is because FormControlLabel is also used for the inline version of the labeled checkboxes/radio boxes. i.e. That margin is what is responsible for the inline list of checkboxes/radio boxes being separated. I'm not sure it's a good idea to make the blank space in between them clickable.

The block/list mode doesn't have use for the space after at all, so rather than swapping margin for padding the correct behaviour is for the margin-right to just not be present (be 0) in fullWidth/block mode.

@oliviertassinari
Copy link
Member

@dantman This sounds fair.

@oliviertassinari oliviertassinari added the new feature New feature or request label Apr 16, 2018
@borzh
Copy link

borzh commented Jan 31, 2019

Currently I am using:
<FormControlLabel style={{ marginRight: -14 }}
as a temporal fix this issue.

@oliviertassinari oliviertassinari removed the new feature New feature or request label Feb 13, 2019
@oliviertassinari
Copy link
Member

I'm closing as it didn't get traction.

@dantman
Copy link
Contributor Author

dantman commented Nov 1, 2019

How/where does it need to get traction?

@oliviertassinari
Copy link
Member

@dantman It's me nicely saying, low priority, let's move to a different problem.

@zannager zannager added the component: FormControl The React component label Dec 20, 2022
@hanseonghye
Copy link

<RadioGroup
      ...
      sx={{
        width: 'auto',
        flexWrap: 'nowrap',
      }}
>


      <FormControlLabel 
            ...
            sx={{
                  width: '100%', margin: '0 !important'
            }}
      >

Im using this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: FormControl The React component
Projects
None yet
Development

No branches or pull requests

5 participants