Skip to content

form-control css class added to checkbox when form_show_labels == False #5

@powderflask

Description

@powderflask

A Checkbox input should not have the form-control css class as bootstrap3 adds height=34px to form-control elements.

crispy-forms 1.14 introduced a bug in bootstrap3/field.html template that causes the form-control css class to be added to the input element when form_show_labels == False

To reproduce, create a form with:

my_checkbox = forms.BooleanField(required=False, widget=forms.CheckboxInput())
form.helper.form_show_labels = False

Rendered field has form-control css class, which styles a form-control-sized checkbox 34px tall.

Use case: a formset view where items can be selected (i.e., each checkbox has no label)

This is easy to fix. I'll follow up with a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions