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 }}
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | accessibility-test-after-patch-3266511-6.png | 65.09 KB | shyam_bhatt |
| #6 | accessibility-test-before-patch-3266511-6.png | 67.63 KB | shyam_bhatt |
| #6 | noissue-3266511-6.png | 82.42 KB | shyam_bhatt |
Issue fork bootstrap_barrio-3266511
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:
- 3266511-barrio-details-elements
changes, plain diff MR !17
Comments
Comment #2
hswong3i commentedComment #3
hswong3i commentedComment #5
hswong3i commentedComment #6
shyam_bhattIn 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.

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

After patch

Comment #7
shyam_bhattComment #10
hatuhay commented