Skip to content

bootstrap_field show_label not honoured for checkboxes #127

Description

@rhelms

Similar to zostera/django-bootstrap3#414, the show_label=False directive is ignored for checkbox fields.

{% bootstrap_field editabletext_form.DELETE layout="horizontal" show_label=False %}

renders

<div class="form-group row">
    <label class="col-md-3 col-form-label sr-only" for="id_detectedtext_set-0-DELETE">&nbsp;</label> 
    <div class="col-md-9">
        <div class="form-check">
            <input type="checkbox" name="detectedtext_set-0-DELETE" class="form-check-input" id="id_detectedtext_set-0-DELETE">
            <label class="form-check-label" for="id_detectedtext_set-0-DELETE">Delete</label>
        </div>
    </div>
</div>

Whilst the first <label> is fine, should sr-only be supported (I haven't actually checked if it is), the second <label> should be suppressed, or also applied with the sr-only class.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions