From 6507399a6776370ce497b46376c5d2802e376fd4 Mon Sep 17 00:00:00 2001 From: Sofia Matulis Date: Wed, 3 Aug 2022 16:02:49 -0400 Subject: [PATCH] Fix filter bug to allow filters to be removed --- assets/facets.js | 2 ++ snippets/facets.liquid | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/facets.js b/assets/facets.js index eef3ead7f49..240ad0ad3a1 100644 --- a/assets/facets.js +++ b/assets/facets.js @@ -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') { diff --git a/snippets/facets.liquid b/snippets/facets.liquid index 4ea4685ef56..732cb3421e8 100644 --- a/snippets/facets.liquid +++ b/snippets/facets.liquid @@ -144,7 +144,7 @@ {%- endfor -%} {% comment %} No show more for no JS {% endcomment %} -