Hey, I found an issue trying to set custom classes on widgets.
The renderer overwrites classes declared on a widget, making it impossible to do this:
my_button = forms.CharField(
label="",
widget=forms.widgets.TextInput(
attrs={
"type": "button",
"value": "Configure",
'class': 'btn-configure', # never included in the class attribute
}
),
)
Fields should add to any existing attributes instead of replacing them.
You must override the class FormRenderer. Simply inherit from formset.renderers.tailwind.FormRenderer and override the method to add the CSS class, aka. _amend_text_input().
Hey, I found an issue trying to set custom classes on widgets.
The renderer overwrites classes declared on a widget, making it impossible to do this:
Fields should add to any existing attributes instead of replacing them.