#36772: `aria-describedby`-Attribute missing from file field HTML in Django 6.0
-------------------------------------+-------------------------------------
     Reporter:  cessor               |                    Owner:  (none)
         Type:  Bug                  |                   Status:  closed
    Component:  Forms                |                  Version:  6.0
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  forms, aria,         |             Triage Stage:
  fieldset, accessibility, admin     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

 * resolution:   => invalid
 * status:  new => closed

Comment:

 Thanks for the test project. I noticed your test manually renders input
 fields instead of directly rendering the form. When a `<fieldset>` is in
 play, it's expected that the aria attribute will be on the `<fieldset>`,
 not the `<input>`, which is what's happening:


 {{{#!py
 In [1]: from django.forms import *

 In [2]: class UploadForm(ModelForm):
    ...:     class Meta:
    ...:         model = Upload
    ...:         fields = ["file"]
    ...:

 In [3]: from pprint import pprint

 In [4]: pprint(UploadForm().as_div())
 ('<div>\n'
  '    <fieldset aria-describedby="id_file_helptext">\n'
  '  <legend>CSV-File:</legend>\n'
  '\n'
  '<div class="helptext" id="id_file_helptext">File containing comma
 separated '
  'values.</div>\n'
  '\n'
  '<input type="file" name="file" required id="id_file"></fieldset>\n'
  '    \n'
  '      \n'
  '    \n'
  '</div>')
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36772#comment:1>
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/0107019aea246174-171ff747-97a6-408a-b68f-2ed223a5d684-000000%40eu-central-1.amazonses.com.

Reply via email to