Open rosscdh opened 1 year ago
Seconded on this one:
This is how django-crispy-forms
handles it:
return isinstance(field.field.widget, forms.RadioSelect) and not isinstance(
field.field.widget, forms.CheckboxSelectMultiple
)
Hi @rosscdh!
Nice to meet you here! 😄
What do you say about @dpjanes suggestion how crispy forms core handles this?
Best
Ronny
as per https://github.com/django/django/blob/main/django/forms/widgets.py#L839
unfortunately the widget inherits from radioselect which means that isinstance will return true an show a radio select due to the order in https://github.com/django-crispy-forms/crispy-tailwind/blob/main/crispy_tailwind/templates/tailwind/field.html#L20
as is demonstrated here
a working fix would be to test for the class name rather?