Problem/Motivation

This is a follow up issue for core patch https://www.drupal.org/project/drupal/issues/2896169, which add aria-describedby attributes for details correctly.

With that changes, theme with details.html.twig need to update accordingly, e.g.

diff --git a/core/themes/classy/templates/form/details.html.twig b/core/themes/classy/templates/form/details.html.twig
index c554096da9d785597c6e1e2c317e940002430981..140fa4ee7da4821b117b09c0eb2bd699013863e8 100644
--- a/core/themes/classy/templates/form/details.html.twig
+++ b/core/themes/classy/templates/form/details.html.twig
@@ -31,8 +31,8 @@
         <strong>{{ errors }}</strong>
       </div>
     {% endif %}
-    {%- if description -%}
-      <div class="details-description">{{ description }}</div>
+    {%- if description.content -%}
+      <div {{ description.attributes.addClass('details-description') }}>{{ description.content }}</div>
     {%- endif -%}
     {%- if children -%}
       {{ children }}
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hswong3i created an issue. See original summary.

hswong3i’s picture

hswong3i’s picture

Title: [] Details elements have incorrect aria-describedby attributes » [Barrio] Details elements have incorrect aria-describedby attributes

hswong3i’s picture

Status: Active » Needs review
Shyam_Bhatt’s picture

In Drupal 9.4 and above version, the admin theme is updated as "Claro". The "aria-describedby" issue is not reflected while we are checking the form with the accessibility tool. Please check the below image with Drupal version 9.4.5 and "Claro" as the admin theme.
2022-08-18/noissue-3266511-6.png

For the below version of drupal and "Seven" as admin theme, the recommended MR (merge request !17) is working fine. Please check the below images:

Before patch
2022-08-18/accessibility-test-before-patch-3266511-6.png

After patch
2022-08-18/accessibility-test-after-patch-3266511-6.png

Shyam_Bhatt’s picture

Status: Needs review » Reviewed & tested by the community

  • hatuhay committed 199fad4 on 5.5.x
    Issue #3266511 by hswong3i: [Barrio] Details elements have incorrect...

  • hatuhay committed 85e9091 on 5.x
    Issue #3266511 by hswong3i: [Barrio] Details elements have incorrect...
hatuhay’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.