Opened 7 months ago
Closed 7 months ago
#35409 closed Bug (worksforme)
CheckbioxMultipleSelect widget is broken
Reported by: | Marc Gomillion | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 4.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
My application has an emailer page with a list of recipients that can be edited as follows.
In the form definition:
recipients = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple)
In __init__
:
self.fields['recipients'].choices = recipient_choices
This has worked since 2009, but Django 4.2.x has broken it as it does not insert line breaks between the recipients and the list is a jumbled mess. I've coded around it by using the SelectMultiple widget, which still allows editing of the list, but not in obvious ways to my users, and is thus unacceptable.
I've attached images of the list using Django 3.2 and 4.2.
Attachments (2)
Change History (3)
by , 7 months ago
Attachment: | recipient list 3.2.png added |
---|
by , 7 months ago
Attachment: | recipient list 4.2.png added |
---|
comment:1 by , 7 months ago
Component: | Uncategorized → Forms |
---|---|
Description: | modified (diff) |
Resolution: | → worksforme |
Status: | new → closed |
Type: | Uncategorized → Bug |
Hello Marc! Thank you for your report. In order to do a proper triage of this ticket, I need your help with the following:
main
branch of the Django project?A few things to note:
<div>
), please check the release notes for 4.1 and 5.0.I tried to reproduce this with no success. My form is as follows:
And when rendering it with
{{ form }}
in a Django template, I get a nice looking form:Closing as
worksforme
until a minimal reproducer or more information is provided.