Apply chosen to facets widgets (mainly dropdown)

Created on 18 July 2020, over 4 years ago
Updated 3 July 2024, 9 months ago

I've been trying for hours to apply chosen to a facets dropdown list. I have already studied all the issues here and in the facets project. According to the issues there once have been some problems which should be solved now.

I would be grateful for a step-by-step guide on how to make chosen work in combination with facets.

This is my configuration: drupal-8.9.1, facets-1.5, chosen-2.x-dev. In the Chosen administration page all parameters are set to "always apply". Apply Chosen to the following elements: select:visible,select,.facets-dropdown,.facets-widget-dropdown Use chosen for admin pages and/or front end pages: Include Chosen on every page. I also made sure Chosen javascript and css files are present on frontend side by theme settings: inside mytheme.info.yml I added:

libraries:  
   - chosen/drupal.chosen

I verified chosen libraries are being loaded on frontend side.

What am I missing here?

💬 Support request
Status

Active

Version

2.0

Component

Documentation

Created by

🇩🇪Germany kreatIL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom effortDee

    If anyone is wondering why there facets are not applying chosen, that is the issue.

    I worked this out, I have two views for two seperate web apps, one of them has exposed filters/sorting options and the other did not.

    The one that only had one facet to filter and no exposed filters/sorting options, chosen did not work.

    The one that had exposed filters/sorting options, chosen worked on the facets on that web app.

    To get around this I added a sorting option and then I removed that with CSS so now chosen works on the facet so it can be searched using chosen.

Production build 0.71.5 2024