jrief / django-formset

The missing widgets and form manipulation library for Django
https://django-formset.fly.dev/
MIT License
317 stars 30 forks source link

Radio buttons in a form not rendered properly when adding new siblings #91

Open carlogravador opened 11 months ago

carlogravador commented 11 months ago

I'm having issues rendering radio buttons if I create a new sibling.

Example of radio button without selection yet: image

After I added a new sibling

Rendered radio button after creating new sibling image

here's a snippet of the form and form collection

# BaseModelForm inherits forms.ModelForm
class MyForm(BaseModelForm): 
...
    is_retired = forms.ChoiceField(required=False,
                                   widget=forms.RadioSelect, label='Is retired?',
                                   choices=RadioButtonChoices.choices)
...

# BaseFormCollection inherits formset.collection.FormCollection
class MyFormCollection(BaseFormCollection):
...
    my_form = MyForm()
    min_siblings = 1
...
jrief commented 11 months ago

just attempted to reproduce this bug but in my case all radio buttons are rendered correctly.

Please check out https://github.com/jrief/django-formset/tree/reproduce-issue-91 and rebuild the project.

Then run the example on http://localhost:8000/bootstrap/contact