duplicate id, invalid markup from Drupal.facets.makeDropdown ul to select

Created on 25 May 2023, over 1 year ago
Updated 26 May 2023, over 1 year ago

Problem/Motivation

The dropdown <select> element has the same ID as the <ul> element it was created from, by Drupal.facets.makeDropdown. Duplicate IDs are invalid HTML per
https://www.w3.org/TR/html401/struct/global.html#h-7.5.2

https://git.drupalcode.org/project/facets/-/blob/2.0.x/js/dropdown-widge...
The code comment says that it will // Preserve all attributes of the list
and it does, including the ID, which should not remain on the list.

Steps to reproduce

Inspect a facet dropdown widget. Or try to run a behat test using the dropdown's ID.

Proposed resolution

When the <select> element is created, remove the duplicate id from the unused <ul> element.

Remaining tasks

User interface changes

-

API changes

-

Data model changes

-

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States RMattB

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024