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

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

Open carlogravador opened this issue 1 year ago • 1 comments

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
...

carlogravador avatar Oct 10 '23 15:10 carlogravador

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

jrief avatar Oct 12 '23 14:10 jrief