django-bootstrap5 icon indicating copy to clipboard operation
django-bootstrap5 copied to clipboard

field_class does nothing.

Open dsluo opened this issue 3 years ago • 2 comments

field_class is documented as an option for the bootstrap_field template tag, but it currently is not used, and does not apply the class to the <input>.

dsluo avatar Feb 23 '22 17:02 dsluo

This can be fixed by adding the following to the add_widget_class_attrs() function within the renderers.py file:

field_classes = [text_value(self.field_class)]

Then append "+ field_classes" to the second to last line of the function:

classes = before + classes + field_classes

This solution is working for me. If there aren't any issues with it, I think it this should be merged into the official code.

lsmith2-edison avatar Jul 23 '22 02:07 lsmith2-edison