I have a CMS filter set up, with a submit button shown on mobile and hidden on desktop. The purpose of this is to have the auto filter on for desktop, but for mobile, the list should filter only on the button press. The problem is, the auto filter is on on both breakpoints. It also auto filters if I set the filter button to display:block on desktop.
Site URL
Required: Please provide a staging/production URL where we can see the issue
Just remove the fs-list-filteron="submit" attribute from your form element. Then, add the script right before the closing </body> tag.
This script automatically detects when the screen is mobile or tablet (width ≤ 991px) and adds the fs-list-filteron="submit" attribute to your filter form. On larger screens (desktop), it removes that attribute so filtering works automatically as usual.
It also listens for screen size changes (like when resizing the browser) and updates the filter behavior dynamically by restarting Finsweet List Filter.