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
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mgifford’s picture

Tim Bozeman’s picture

@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.

mgifford’s picture

Maybe 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.

Tim Bozeman’s picture

Assigned: Tim Bozeman » Unassigned
Category: Bug report » Feature request
Priority: Normal » Minor
Issue summary: View changes
Status: Active » Closed (duplicate)