Streaming live at 10am (PST)

Load my page with a filter applied / Finsweet filters / Checkbox checked

Hi everyone !

Simple problem : I would like to load my collection with this filter (checkbox checked) applied.

So I put my checkbox to “start-checked” (also tried value=checked).
It visually work, but the checkbox don’t filter the collection, it seems to be only an “after-load” possible action.

Here’s the read-only link
Here’s the published link.

I’m using @Finsweet filters, here’s the doc (which you can see in my before body tag code) : Finsweet filters documentation. But I don’t see any mention about start-checked or preload checked button…
I tried “value”=“checked” in custom input attributes but same problem.
“activeClass” parameter is only a visually effect too.

@Finsweet, your help would be much appreciated :slightly_smiling_face: !

Thanks,
William

Finsweet offers support for their script at https://www.sweetjs.io

Right, I asked them on the slack and they saved me !
Thanks for the reply.

Here’s the solution, to paste after the filter script :

document.addEventListener('DOMContentLoaded', ()=>{
         document.querySelector('.checkBoxClass').checked = true;
         document.querySelector('.checkBoxClass').click();
    })