Toggle fields: facet counts don't work

Hello!

I’m rolling out attributes V2 on some sites, but I’m facing one small bug that stopped me in my tracks

  • The facets for toggle fields aren’t displaying the amount of content it should

Here’s a little test branch: Filters V2

Here’s my script:

<script async type="module"
src="https://cdn.jsdelivr.net/npm/@finsweet/attributes@2/attributes.js"
fs-list
fs-list-activeclass="is-active"
fs-list-filteringclass="is-filtering"
fs-list-loadingclass="is-loading"
fs-list-startingclass="is-starting"
fs-list-emptyclass="is-empty"
fs-list-showquery="true"
></script>

Here’s how you replicate the bug:

  • Open the “More” accordion in the left sidebar
    • :bug: Both toggles have a facet value of 0, despite containing 22 and 2 results respectively

What’s puzzling me is that facets work perfectly for the checkbox fields in the other two categories! It’s just specifically for toggle fields that it isn’t work, yet the toggle fields work perfectly themselves.

I’d love some help on this one! Excited to finally roll out V2 everywhere :sun:

Hey @Thomas! Thank you for pointing this out!

There was a small bug. We have pushed a fix, and the facet count should now work as expected!

To test, please use an incognito window or clear your cache and reload the page.

Let me know how it goes!

1 Like