
Topic summary
A Shopify store owner wants filters to auto-close when opening a new one, rather than having multiple filters remain open simultaneously.
Current Issue:
- When opening a filter (e.g., color), previously opened filters (e.g., price) stay open
- Desired behavior: only one filter section open at a time
Solution Provided:
A JavaScript code snippet was shared that:
- Targets
details.accordionelements - Automatically closes previously opened filters when a new one is clicked
- Manages
aria-expandedattributes for accessibility
Status:
The solution has been provided with a visual demonstration (GIF). The original poster is seeking clarification on where exactly to add the script in their Shopify theme. The discussion remains open as implementation guidance is still being requested.