diff --git a/core/includes/theme.inc b/core/includes/theme.inc index b62ad74..92a1286 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1858,6 +1858,11 @@ function template_preprocess_container(&$variables) { $element['#attributes']['class'][] = 'form-wrapper'; } + // Add the aria-describedby attribute for date fields. + if (isset($element['widget']['#attributes']['aria-describedby'])) { + $element['#attributes']['aria-describedby'] = $element['widget']['#attributes']['aria-describedby']; + } + $variables['children'] = $element['#children']; $variables['attributes'] = $element['#attributes']; } diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module index 5d13413..10c75eb 100644 --- a/core/modules/datetime/datetime.module +++ b/core/modules/datetime/datetime.module @@ -239,7 +239,6 @@ function template_preprocess_datetime_wrapper(&$variables) { if (!empty($element['#description'])) { // Add aria-describedby attribute to title tag for screen readers. - // $variables['title']['#attributes']['aria-describedby'] = $element['#attributes']['aria-describedby']; $variables['description'] = $element['#description']; $variables['attributes']['class'][] = 'description'; // Associate the description with the aria-describedby attribute.