#314385: Make position of #description configurable via the API introduced the #description_display attribute, which controls placement of the form element #description. The options for #description_display are "before", "after" or "invisible".
But when using #description_display with the fieldset form element ('#type' => 'fieldset'), the Form API ignored the option and the description was always placed after any elements inside the fieldset. These options are now correctly applied for the fieldset element.
Is your site effected?
If your site is only using themes provided by Drupal core (Bartik, Olivero, Seven, Claro and/or Umami), upgrading to the latest version is the only requirement to get the fix. The Classy, Stable and Stable9 base themes have also been fixed. So if your site is using a theme that defines any of those as its base theme, upgrading to the latest version of core should also fix this bug. However, if your site is using a theme that uses something else as a base theme and/or if your site theme provides its own version of the fieldset.twig.html template, you must update your copies of the template for the fix to work.
If you maintain one or more contributed theme projects that override this template, you will also need to update this template for the fix to work.
Changing an overridden fieldset.html.twig template to benefit from the fix
Before
<fieldset{{ attributes.addClass(classes) }}>
...
<div class="fieldset-wrapper">
...
{{ children }}
...
{% if description.content %}
<div{{ description.attributes.addClass('description') }}>{{ description.content }}</div>
{% endif %}
</div>
</fieldset>
After
<fieldset{{ attributes.addClass(classes) }}>
...
<div class="fieldset-wrapper">
{% if description_display == 'before' and description.content %}
<div{{ description.attributes.addClass('description') }}>{{ description.content }}</div>
{% endif %}
...
{{ children }}
...
{% if description_display in ['after', 'invisible'] and description.content %}
<div{{ description.attributes.addClass('description') }}>{{ description.content }}</div>
{% endif %}
</div>
</fieldset>