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

bootstrap_field show_label not honoured for checkboxes #127

Open
rhelms opened this issue Dec 20, 2018 · 1 comment
Open

bootstrap_field show_label not honoured for checkboxes #127

rhelms opened this issue Dec 20, 2018 · 1 comment
Assignees
Labels

Comments

@rhelms
Copy link

rhelms commented Dec 20, 2018

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.

@dyve dyve self-assigned this Apr 22, 2020
@jannh
Copy link

jannh commented May 10, 2020

Btw: The same goes for the label_class attribute for checkboxes. If a different label_class is specified in the bootstrap_field, it does not appear in the html (will always be "form-check-label").

@dyve dyve added the bug label May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants