Opened 25 hours ago
Last modified 5 hours ago
#36829 assigned Bug
Breaking change in ClearableFileInput
| Reported by: | Johannes Maron | Owned by: | Johannes Maron |
|---|---|---|---|
| Component: | Forms | Version: | 6.0 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Johannes Maron, Antoliny | Triage Stage: | Unreviewed |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | yes |
Description (last modified by )
Howdy y'all,
#35892 flipped django.forms.widgets.ClearableFileInput.use_fieldset from false to true.
The change can be found here: https://github.com/django/django/blame/4187da258fe212d494cb578a0bc2b52c4979ab95/django/forms/widgets.py#L533
This changes the form rendering outside the admin too. Probably just a small oversight and not an intentional change, since changes weren't accompanied by release notes.
Anyhow, both the input and the use_fieldset are part of the public documentation, and changes must undergo deprecation.
The problem gets amplified with #36828, since the current fieldset implementation violates HTML and WCAG 2.1
The only affected version is 6.0. I would recommend providing a regression patch in the next bugfix release.
Cheers!
Joe
Attachments (1)
Change History (7)
comment:1 by , 25 hours ago
| Description: | modified (diff) |
|---|
comment:2 by , 22 hours ago
comment:3 by , 16 hours ago
Thank you for reporting this issue, Joe :)
In my view, using a fieldset for ClearableFileInput itself makes sense.
However, I also agree that it’s a problem that a change related to the admin affected form rendering outside of the admin as well (and that this wasn’t communicated).
As Tim suggested, should this change be limited to the admin only?
comment:4 by , 16 hours ago
| Cc: | added |
|---|
comment:5 by , 6 hours ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
Agreed, let's limit the change to the admin, since its widgets aren't publicly documented.
I'll attach a potential patch.
by , 6 hours ago
| Attachment: | ticket-36829.patch added |
|---|
comment:6 by , 5 hours ago
| Has patch: | set |
|---|
It might be that only
AdminFileWidget(theClearableFileInputused in admin forms) should have that attribute.