Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filter bug to allow filters to be removed #1890

Merged
merged 1 commit into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
sofiamatulis marked this conversation as resolved.
Show resolved Hide resolved
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