#36828: Django form fields render into invalid HTML
--------------------------------+--------------------------------------
     Reporter:  Johannes Maron  |                     Type:  Bug
       Status:  new             |                Component:  Forms
      Version:  dev             |                 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
--------------------------------+--------------------------------------
 Howdy,

 Django 6 introduced unannounced changes to the default form rendering.
 Forms render with a fieldset, not a label, by default now.

 I just noticed that fields render a `for`-attribute into a `legend`-tag.
 This isn't valid HTML5 according to spec: https://html.spec.whatwg.org
 /#the-legend-element

 Furthermore, the use of a fieldset/legend replaces the `label`-tag.
 However, input labels are required as of WCAG 2.1.

 Since Django must be WCAG2.2 AAA compliant, we might even want to patch
 all supported versions.

 This bug was introduced only in Django 6.0, which is wild, since the
 release notes don't even mention any rendering changes. After some
 research, the change was introduced in #35892. I will open a separate
 issue about the missing release documentation and breaking change.

 Cheers!
 Joe
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36828>
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019b5b53c7b7-c4b8fd35-33ab-4221-9304-dbb8559780c3-000000%40eu-central-1.amazonses.com.

Reply via email to