Opened 21 hours ago
Last modified 87 minutes 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.
Change History (2)
comment:1 by , 14 hours ago
Summary: | Split datetime input should have accessible name → AdminSplitDateTime labels are not associated with their inputs |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Bug |
comment:2 by , 87 minutes ago
Hi Sarah! Just to clarify -- are you saying we should tackle this ticket after #35892 has been merged?
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