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 missing class to checkbox wrapper #83

Merged

Conversation

djw
Copy link
Contributor

@djw djw commented Dec 7, 2021

From the docs, checkboxes should have the form-check class on their wrapper element, unless the label is omitted:

<div class="form-check">
  <input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
  <label class="form-check-label" for="flexCheckDefault">
    Default checkbox
  </label>
</div>

<div>
  <input class="form-check-input" type="checkbox" id="checkboxNoLabel" value="" aria-label="...">
</div>

This PR adds this logic.

@smithdc1
Copy link
Member

Thanks for the patch, looks good to me.

I'm now thinking about form-horizontal but that's a separate issue!

@smithdc1 smithdc1 merged commit 8bccd51 into django-crispy-forms:main Dec 11, 2021
@djw djw deleted the checkbox-missing-class branch December 12, 2021 09:55
@smithdc1 smithdc1 added this to the Next Release milestone Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants