Change record status: 
Project: 
Introduced in branch: 
11.3.x
Introduced in version: 
11.3.0
Description: 

Details form elements with descriptions were given an invalid aria-describedby attribute whose target did not correspond to any HTML element. All core templates have been updated to add the id to a wrapper around the description. If you have overridden the details.html.twig template, then you should update your template in order to have valid markup and improve accessibility.

Basic Example

Before:

  {{ description }}

After:

  {%- if description -%}
    {% set description_attributes = create_attribute({id: attributes['aria-describedby']}) %}
    <div{{ description_attributes }}>{{ description }}</div>
  {%- endif -%}

Example description with pre-existing wrapper

Before:

    {%- if description -%}
      <div class="details-description">{{ description }}</div>
    {%- endif -%}

After:

    {%- if description -%}
      {% set description_attributes = create_attribute({id: attributes['aria-describedby']}) %}
      <div{{ description_attributes.addClass(['details-description']) }}>{{ description }}</div>
    {%- endif -%}
Impacts: 
Themers