[Facets 3] Render using theme input and select instead of lists with links for checkboxes and dropdown

Created on 20 August 2025, 3 days ago

Same as 🐛 Render using theme input and select instead of lists with links for checkboxes and dropdown Needs review , but with an MR for Facets 3. Rebasing an old issue MR can be complicated (it requires godlike Git skills ) and may cause an issue to stall.

Problem/Motivation

Currently the facets are always rendered as lists with links, which are rewritten by javascript to form elements.
A few issues arise:

  • In some themes javascript is loaded from the footer, some flickering may arise.
  • Slight lag ofcourse because javascript has to do it's thing to enable checkboxes and dropdowns
  • Styling issues, because the form elements are not rendered by the theme functions of these elements, the html is different and it has to be styled and fixed seperately. For a lot of frontenders this could be found annoying.

What did I do?

  • Rewritten the DropdownWidget and CheckboxWidget to render the elements serverside using the theme functions for select and checkbox (input__checkbox).
  • Rewritten the javascript just to trigger on change events for checkboxes and facets.
  • Also fixed that theme suggestions are correctly added for the available widget types.
  • Added a twig file for checkboxes, because for this element we do not need the (-) element anymore when it is active.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇩🇰Denmark ressa Copenhagen

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024