Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Same issue as 2126761. The datetime help text field says that it is a description field, but has no ID pointing to what it is describing.
<div class="description">Some really helpful text.</div>
This is a problem for users using a screen reader. Without a description, it is not apparent what the field is for.
To reproduce:
- add a date field to a content type
-
add help text to the field.
- e.g. for the article content type go to admin/structure/types/manage/article/fields/node.article.field_date_time
- add a node and inspect the markup for the datetime help text
Proposed resolution
- add an attributes variable to datetime-wrapper.html.twig
- include the variable in template_preprocess_datetime_wrapper()
Remaining tasks
- Create an initial patch
- find a new home
Comment | File | Size | Author |
---|---|---|---|
#2 | datetime-field-aria-describedby-2244923-2.patch | 2.02 KB | Tim Bozeman |
#1 | date-aria-describedby.png | 90.12 KB | mgifford |
Comments
Comment #1
mgiffordHopefully it takes less time to fix than #2126761: The body field summary textarea indicates it has a description with aria-describedby attribute, but the DOM id value points to a non-existent node - thanks for raising this Tim.
I can see that this should be a problem, but I can't see the aria-describedby..
Comment #2
Tim Bozeman CreditAttribution: Tim Bozeman commented@mgifford Thank you again for walking me through that I really did learn a lot. I don't aim to let grass grow under my feet on this one. Here is my first stab at it.
Comment #3
mgiffordMaybe we should combine this issue with #1918994: Improve Datetime and Daterange Widget accessibility and add aria-describedby there:
<fieldset class="fieldgroup form-composite" {{ aria-describedby }}>
I didn't see it in the source when I looked at the results of the patch.
Comment #4
Tim Bozeman CreditAttribution: Tim Bozeman commentedMoved to #1918994: Improve Datetime and Daterange Widget accessibility and closed as duplicate