Skip to content

Add missing class to checkbox wrapper#83

Merged
smithdc1 merged 1 commit into
django-crispy-forms:mainfrom
brightnetwork:checkbox-missing-class
Dec 11, 2021
Merged

Add missing class to checkbox wrapper#83
smithdc1 merged 1 commit into
django-crispy-forms:mainfrom
brightnetwork:checkbox-missing-class

Conversation

@djw

@djw djw commented Dec 7, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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