Opened 6 weeks ago

Last modified 6 weeks ago

#36203 assigned Bug

AdminSplitDateTime labels are not associated with their inputs

Reported by: Eliana Rosselli Owned by: Eliana Rosselli
Component: contrib.admin Version: 5.1
Severity: Normal Keywords: accessibility
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Split Date Time inputs in the Django Admin don't have accessible names. Testing with a screen reader, there's nothing spoken aloud when entering one of the inputs (both for the date and the time input). The name of the field is a label element but it isn't related to either of the two inputs, and the "Date" and "Time" texts aren't labels either.

An example of this kind of input can be found in this demo page : if you scroll all the way down, you can see that the "Important Dates" section contains two split datetime inputs ("Last login" and "Date joined") that suffer from this problem. In this case, I think the accessible names of the inputs should be something along the lines of "Last login, date" and "Last login, time" for example.

According to the ticket's flags, the next step(s) to move this issue forward are:

  • To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is: [https://github.com/django/django/pull/#### PR].

Change History (2)

comment:1 by Sarah Boyce, 6 weeks ago

Summary: Split datetime input should have accessible nameAdminSplitDateTime labels are not associated with their inputs
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

Thank you Eliana, great spot! This can definitely be quite a bit better.

Note that we would want this to be a <fieldset> that is labelled by the field name (e.g. "Last login:") ideally as a <legend>. This should be covered by #35892

comment:2 by Eliana Rosselli, 6 weeks ago

Hi Sarah! Just to clarify -- are you saying we should tackle this ticket after #35892 has been merged?

Note: See TracTickets for help on using tickets.
Back to Top