Open nategro opened 6 years ago
If there is no interest in discussing this any further, I think we should close this issue.
Just stumbleded around this issue trying to find an "easy" way to add custom css (and data-attributes) to a widget (in order to use bootstrap-select). Kinda surprised that this is not supported.
However you can use django-widget-tweaks in order to customize the input widget before it is handled by django-bootsrap4. This might be a nice solution:
{% bootstrap_field form.field|add_class:"what_ever_class_you_like"|attr:"data-foo:bar" %}
I am looking for an opportunity to add custom css classes to a form widget and extend its 'form-control' class by using the template tag. Unfortunately the parameter 'field_class' modifies a higher-level DIV.