-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Custom Control Checkbox not working without label #26221
Comments
Yup i got the same problem. I have a table of radio buttons and the label is in the table column headers. The custom radio buttons don't show up if there's no label.
It doesn't work with or without the I did more tests and it absolutely needs a label with the class I guess the custom control is tied to |
why omitted the tag ? you can let the label text empty or use sr-only ? |
@jipexu it doesn't work either if you add the |
you noticed this for the 4.0 and 4.1 ? |
I'm on 4.0.0 right now which is the last version published on npm. |
i use this method empty label in several context ... probably not the best way but found only this one |
I just updated to 4.1.0 and still not showing up. I guess i'll have to use an empty label for now. Here's what i did i think it's probably cleaner than an empty label :
|
My version is 4.0.0 published on npm. Working with empty labels is working, but thats not a good practice as it results in unneeded code overhead. |
I looked at the css code and i don't think it's an issue. It's actually by design. The |
The custom checkbox is also off-center when used with a blank label. |
@AndyCJ It's because the |
Thank you for the suggestion, that worked a treat. I'll pop a helper class in to our SASS to cover this usage. I agree you want a label when making a "classic" form layout for sure. |
Docs explain how these are built—the |
I have the same problem (v 4.1.1) |
This problem starts from Bootstrap v4.1.1 (#25944) Fix empty custom-control-label alignment issue .custom-control-label {
vertical-align: top;
} source: #27566 (comment) |
I know this is a little late hah. Just for future reference
|
I've checked and checked and checked all over again and realized that I've forgotten to put for attribute to the label... |
Checkboxes aren't working properly for 'mass' checking. |
Suggesting we reopen this. When hiding label using the "text-hide" method, checkboxes are still off centered due to the padding that exists to offset the label from the checkbox. |
.custom-control {
padding-left: 0;
.custom-control-label {
// set same width/height as before and after
width: 1em;
height: 1em;
&::before,
&::after {
left: 0;
}
}
.custom-control-input {
display: none; // optional
}
} |
The problem is, that You have to use label "for" attribute, and id for input, because it triggers the script |
This worked 100% for me. Checkbox is there without label:
|
When ommitting the label tag in a custom-control-input, the checkbox is not showing up
Sometimes one would need a styled checkbox without a label, especially when working with selection lists or tables.
The text was updated successfully, but these errors were encountered: