az-digital / az_quickstart

UArizona's web content management system built with Drupal 10.
https://quickstart.arizona.edu
GNU General Public License v2.0
30 stars 20 forks source link

Webform | Multi-select fields receiving duplicate required asterisks #3453

Closed akslay closed 1 day ago

akslay commented 1 month ago

Problem/Motivation

Webforms with multi-select fields (checkboxes, checkboxes other, radios, radios other, etc.) are receiving duplicate required asterisks.

Examples on live sites:

Describe the bug

The .form-required class is being applied to both the <legend> element and the <span> nested inside it, resulting in two asterisks.

To Reproduce

Create a Webform with a checkboxes field (multiple options), and make it required.

Proposed resolution

I was unable to find a drupal.org issue for this problem. Seems like it might be stemming from a QS template (themes/custom/az_barrio/templates/forms/fieldset.html.twig) on Line 38 & Line 46.

Expected behavior

Only one asterisk per required Webform field.

Screenshots

Example 1:

Example 2:

akslay commented 2 days ago

Barrio adds the .*-required classes to the <span>, and not the <legend>, so I will remove the duplicate classes from the <legend>. https://git.drupalcode.org/project/bootstrap_barrio/-/blob/5.x/templates/form/fieldset.html.twig