-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Checkboxes won't render without label, and label needs to be in the right place #1376
Comments
This is on purpose. We are looking into using a wrapping label format in the future tho. |
This proves quite difficult when pairing with other libraries. Might another solution or workaround be provided, so that I will not need to custom build to avoid this problem or hack JS/override CSS? Thanks so much for a really, really nice library. |
The reason I brought it up is I needed to make an inline list of checkboxes to represent weekdays. To actually understand which checkbox goes with which label, I would need to reverse them. For now I'll need to do some weird CSS to accomplish this... not a problem, but not quite right either. Thanks! |
any news on the wrapping label format? Would be nice :-) |
Most certainly +1ing this, I typically think that for a browser checkbox that there are way too many circumstances for it to be useful, and the base override being applied in a blanket style is too restricting, would there be a way of adding something like a 'browser-default' class (or adding classes to the checkbox+label combo) in order to have the browser defaults applied? |
👍 Same problem here. Why does the whole checkbox disappear if there is no label? I don't want my checkboxes to have a label.... |
Same problem...how would i tie an event to emit a check all function |
Same problem, I wanted to render a checkbox for a table row (with no label obviously), is this possible even with a workaround? |
Not a real solution, but when using checkboxes in a datagrid, I used the following CSS to get them to show up without labels:
|
@friek108 you can use a space as a checkbox label on a table row <td class="action-checkbox">
<input class="action-select" name="_selected_action" id="_selected_action_1" type="checkbox" value="2483">
<label for="_selected_action_1"> </label>
</td> |
I think even a comment works. 😃 |
Thanks all. The above works for a grid. The challenges continue as there are backend libraries out there that render checkboxes in different ways - eg. yii2 wraps all checkboxes like this: |
Is there any way I can use default checkbox ? |
+1 I am experiencing a few performance issues, I suspect caused as a consequence of the animation. (and I have an Angular watcher for bulk select with these checkboxes) |
This is causing problem in Django formsets since the label changes depending on the checkbox id #. |
To solve this, labels could be added at runtime. http://codepen.io/kmmbvnr/pen/VpppEe
|
Checkboxes disappeared. The following code exists in a library and I could not modify it.
Here is a simple workaround. It worked for me.
|
This is magic css to repair spoiled by materialze css. [type="checkbox"]:not(:checked), [type="checkbox"]:checked { I think it is absurd to hide all inputs, even those that are not changed. It is not too complicated to hide those that have labels .... Why authors dont add some var or class for replaced checkboxes and only this is hidden ? |
Checkbox samples in your website doesn't follow the label order and so they are not shown. Please fix the code shown here: https://materializecss.com/checkboxes.html |
If you want to use the checkbox without a visible span and not be able to click outside the box, use this. <label>
<input type="checkbox"/>
<span style="padding-left: 0px;">
</span>
</label> |
This will work:
|
My personal work-around is using switches instead of check boxes https://materializecss.com/switches.html |
I've noticed that checkboxes only appear if they are coded like this:
<input type="checkbox" id="checkboxid"><label for="checkboxid">Yes?</label>
These do not work:
<input type="checkbox" id="checkboxid">
<label for="checkboxid">Yes?</label><input type="checkbox" id="checkboxid">
<label>Yes?<input type="checkbox" id="checkboxid"></label>
<label><input type="checkbox" id="checkboxid">Yes?</label>
Thanks!
The text was updated successfully, but these errors were encountered: