Skip to content

Commit

Permalink
Fix filter bug to allow filters to be removed (#1890)
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiamatulis authored Aug 4, 2022
1 parent 87b7f1e commit 7a05ef0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions assets/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ class FacetFiltersForm extends HTMLElement {
sortFilterForms.forEach((form) => {
if (!isMobile) {
if (form.id === 'FacetSortForm' || form.id === 'FacetFiltersForm' || form.id === 'FacetSortDrawerForm') {
const noJsElements = document.querySelectorAll('.no-js-list');
noJsElements.forEach((el) => el.remove());
forms.push(this.createSearchParams(form));
}
} else if (form.id === 'FacetFiltersFormMobile') {
Expand Down
2 changes: 1 addition & 1 deletion snippets/facets.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
{%- endfor -%}
</ul>
{% comment %} No show more for no JS {% endcomment %}
<ul class="{% if filter_type != 'vertical' %} facets__list{% endif %} list-unstyled no-js" role="list">
<ul class="{% if filter_type != 'vertical' %} facets__list{% endif %} no-js-list list-unstyled no-js" role="list">
{%- for value in filter.values -%}
<li class="list-menu__item facets__item">
<label for="Filter-{{ filter.param_name | escape }}-{{ forloop.index }}-no-js" class="facet-checkbox{% if value.count == 0 and value.active == false %} facet-checkbox--disabled{% endif %}">
Expand Down

0 comments on commit 7a05ef0

Please sign in to comment.