-
Notifications
You must be signed in to change notification settings - Fork 84
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
CheckboxMultipleInput does not render form-invalid #85
Comments
We could start with a test that fails. What's the expected output? |
The error message is rendered but appears to be hidden by Bootstrap. |
I'm assuming bootstrap doesn't know what to do with the overall div In order for each individual checkbox to turn red the result on each input should be
|
Found the issue, It would be best to add the is-invalid/is-valid wherever this initially gets formed, could you point me to the correct location in the code? This code added to the end will fix it
Investigation:
|
The problem is in the subwidgets. I have a first fix that at least makes the error message display, but it would be nice to get the individual inputs to become |
I think the best way might be to pass the validity argument to the template through the widget class. I'll look into it tomorrow. |
The good news is that the validity is already stored in widget.attrs['class'] which is passed to the template: if we update django_bootstrap5/templates/django_bootstrap5/widgets/radio_select.html to the following it works!
|
<input class="form-check-input #ADD ERROR HERE"
on each form-check-input the error should be displayed
I'll update this if I figure out where this code gets generated.
It's super hack-y but this works added to the end of renderers.py
The text was updated successfully, but these errors were encountered: