- @saidatom opened merge request.
- πΊπ¦Ukraine Foxy-vikvik
For the "drupal/facets": "^3.0@beta"
This is working for all levels.
Facets soft limits JS is breaking facets tree manipulations.
I built a custom module that interacts with the facet list to become collapsible if you have a hierarchical facet.
With the current implementation, the selector used in soft-limit.js breaks if some facet results are still hidden (which could make sense with a collapsible hierarchy).
Consider the following hierarchical facet:
Tree:
- Val 1
- Val 2
-- Val 2.1
-- Val 2.2
--- Val 2.2.1
--- Val 2.2.2
- Val 3
- Val 4
-- Val 4.1
-- Val 4.1.2
- Val 5
- Val 6
- Val 7
With a soft limit of 5 items, Val 1, Val 2, Val 3, Val 4, Val 5 are visible by default. If you click on "view more", Val 6 and Val 7 are shown. If you click on "view less", the values 6 and 7 are hidden. This is consistent.
Now, if you add some JS logic to let the hierarchy be collapsible, the default output of the facet is:
- Val 1
- Val 2
- Val 3
- Val 4
- Val 5
- Val 6
- Val 7
The soft limit shows Val 1 to 5. If you click on "view more", you see Val 6 and Val 7 BUT if you click on "view less", Val 6 and Var 7 are not hidden due to the fact that Val 2.1, Val 2.2 and so on are still hidden.
This is due to the current selector used in the script.
Change the selector to apply to direct children li.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
For the "drupal/facets": "^3.0@beta"
This is working for all levels.