#35273: AdminFileWidget renders two elements with the same ID
------------------------------------------+------------------------
               Reporter:  Johannes Maron  |          Owner:  nobody
                   Type:  Bug             |         Status:  new
              Component:  contrib.admin   |        Version:  5.0
               Severity:  Normal          |       Keywords:
           Triage Stage:  Unreviewed      |      Has patch:  0
    Needs documentation:  0               |    Needs tests:  0
Patch needs improvement:  0               |  Easy pickings:  0
                  UI/UX:  0               |
------------------------------------------+------------------------
 The `AdminFileWidget` renders both the checkbox and file input with the
 same attributes, including the ID.
 The template actually renders the ID attribute twice.

 Both, two identical attributes on an element or two elements with the same
 ID are in violation with version of HTML.

 See
 
https://github.com/django/django/blob/eff21d8e7a1cb297aedf1c702668b590a1b618f3/django/contrib/admin/templates/admin/widgets/clearable_file_input.html#L3

 This first appeared in Django 5.0.

 My suggestion would be to avoid rendering `attrs` into the checkbox.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35273>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e0f69e365-ca525749-5d5d-44ac-8cf0-c196c4ef50df-000000%40eu-central-1.amazonses.com.

Reply via email to