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

Vertical alignment of radio/checkbox broken #27755

Closed
drauch opened this issue Dec 3, 2018 · 11 comments
Closed

Vertical alignment of radio/checkbox broken #27755

drauch opened this issue Dec 3, 2018 · 11 comments

Comments

@drauch
Copy link

drauch commented Dec 3, 2018

Bug reports must include:

Even in the default theme it is visible that the radio/checkbox controls are slightly located upwards compared to the label text. It becomes more apparent if you use a custom theme.

@XhmikosR
Copy link
Member

XhmikosR commented Dec 3, 2018

Confirmed, just note that v4.0 is quite old. Also happens with Firefox on Windows 10 for me.

Current v4-dev live preview https://twbs-bootstrap4.netlify.com/docs/4.1/components/forms/#default-stacked

@XhmikosR
Copy link
Member

XhmikosR commented Dec 3, 2018

@twbs/css-review: using margin-top: .5rem fixes the issue for me, but I'm not sure about other OS'es.

@MartijnCuppens
Copy link
Member

Chrome on windows:

Chrome on mac:

The height and width of the checkbox on windows is 13px, on mac it's 14px. I don't know if there is a way to create a solution for all OS'es 🤔

@drauch
Copy link
Author

drauch commented Dec 3, 2018

@MartijnCuppens: maybe fix it with JavaScript? ¯_(ツ)_/¯

@XhmikosR XhmikosR changed the title Verical alignment of radio/checkbox broken Vertical alignment of radio/checkbox broken Dec 4, 2018
@herbalite
Copy link

https://stackoverflow.com/questions/306924/checkbox-size-in-html-css
@MartijnCuppens Above a link to SO with some approaches. Don't think any of them are without issues though, but if it points into the right direction it's worth to check it out.

@trollwinner
Copy link

Hello everyone!

I don't know if somebody met this issue before but I see the custom controls might have a problem with the alignment with some font-families. Here is an example of "monospace":

Forms · Bootstrap

This extra property should help with it.

.custom-control-label {
    line-height: $font-size-base * $line-height-base;
}

Forms · Bootstrap (1)

@arcanisgk
Copy link

I have detected in V4.5 that it is not the only problem; even if we want to place the checkbox in the same row as an input or a Label of normal dimensions; it turns out that the checkbox goes crazy and does not align vertically or horizontally in the markup:

https://stackoverflow.com/questions/64579724/bootstraps-v4-5-checkbox-cannot-be-aligned-horizontally-or-vertically-when-next

image

@mdo
Copy link
Member

mdo commented Jan 10, 2021

Going to consider this one a won't fix given v5 revamped our checks and radios to be custom, consistent sizes.

@mdo mdo closed this as completed Jan 10, 2021
@XhmikosR
Copy link
Member

I'd say this is still a valid 4.x bug and should be tackled @mdo.

@XhmikosR XhmikosR reopened this Jan 10, 2021
@mdo
Copy link
Member

mdo commented Jan 10, 2021

Given how the components are built, there's not really much flexibility here when v4 has two checkbox and radio components. We're absolutely positioning elements that have variable sizes. The only solution really is the custom forms in v4 and our unified forms in v5. You can see the referenced PR from @MartijnCuppens was closed too because it introduced new issues.

@XhmikosR
Copy link
Member

All right, closing then. I wish there was a way to fix this issue in v4 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants