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 support for inline checkboxes #192

Open
akifd opened this issue Oct 28, 2021 · 3 comments
Open

Add support for inline checkboxes #192

akifd opened this issue Oct 28, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@akifd
Copy link

akifd commented Oct 28, 2021

Currently it is not possible to render checkboxes inline as in Bootstrap documentation: https://getbootstrap.com/docs/5.1/forms/checks-radios/#inline

I would need this option in the bootstrap_field template tag.

@dyve dyve added the enhancement New feature or request label Nov 1, 2021
@akifd
Copy link
Author

akifd commented Dec 28, 2021

It actually seems like this is supported, but only for the CheckboxInput, which only renders one checkbox. To render multiple checkboxes, CheckboxSelectMultiple must be used.

https://github.com/zostera/django-bootstrap5/blob/v21.3/src/django_bootstrap5/renderers.py#L504

Could the above line be changed to include CheckboxSelectMultiple, i.e. isinstance(self.widget, [CheckboxInput, CheckboxSelectMultiple])?

@mmirate
Copy link

mmirate commented Jan 13, 2023

Actually, the relevant part of the code is here, in a template, where the classes of the containing div are 100% hard-coded.

@boxydog
Copy link

boxydog commented Jun 26, 2023

The same goes for radio buttons.

Changing line 8 of the code referenced above:

            <div class="form-check">

to

            <div class="form-check form-check-inline">

renders inline radio buttons, but there is no way to pass in that option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants