-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
4.0 Beta 3 - Custom Checkboxes Are Unclickable Without ID on Input Element #25179
Comments
The https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#attr-for It wasn't required in 4.0.0-beta.2 because the https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#Usage_notes See this PR, which explains some of the rationale behind this change: #25050 |
If you want the same behavior without having to use id for your inputs, just make the "custom-control" classed element the e.g., your pen: |
Last two comments are correct. |
Thanks! Works with BS 4.3.1. Another example: <div class="form-group">
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input">
<span class="custom-control-label">
fancy label for fancy checkbox
</span>
</label>
</div> Happy coding. |
In updating my Beta 2 code to Beta 3, one of the breaking changes concerns custom checkboxes.
Consider the following:
Without an
ID
on theinput
, the checkbox is unclickable. Adding the ID (and referencing it in thefor=
attribute on thelabel
restores this functionality. While the example docs do show an ID, this was not required by custom checkboxes in Beta 2 and should be noted.Also, the documentation still refers to a
span
tag which is no longer used in custom checkboxes.See the example Pen: https://codepen.io/Joyrex/pen/qpjvVx
Add
id="chbxTerms"
to theinput
element and the checkbox becomes clickable.Originally discovered in Chrome 64 Windows 10 64-bit, but also in Chrome mobile (iOS) and Safari Mobile (iOS 11.2)
The text was updated successfully, but these errors were encountered: