django-crispy-forms / crispy-bootstrap5

Bootstrap5 template pack for django-crispy-forms
MIT License
451 stars 72 forks source link

Switch does not support form-check-reverse #165

Closed slinkymanbyday closed 9 months ago

slinkymanbyday commented 9 months ago

Due to an extra div, when using the Bootstrap5 class "form-check-reverse" in the wrapper_class section, the results aren't what is expected (that is the label and switch are flipped). See https://deploy-preview-33606--twbs-bootstrap.netlify.app/docs/5.1/forms/checks-radios/#reverse

Is this line needed? https://github.com/django-crispy-forms/crispy-bootstrap5/blob/main/crispy_bootstrap5/templates/bootstrap5/layout/switch.html#L7

I have made my own template for now, but would be good to be supported. I'm not really sure what this other div does, so probably not best placed to raise a PR.

slinkymanbyday commented 9 months ago

not sure what i was doing wrong, but this seems to be working for me now, closing