diff --git a/make_post_sell/static/js/tag_filter.js b/make_post_sell/static/js/tag_filter.js index d2d5c55..4d5a657 100644 --- a/make_post_sell/static/js/tag_filter.js +++ b/make_post_sell/static/js/tag_filter.js @@ -33,6 +33,18 @@ return; } + // When the page was loaded with ?tag=, the server rendered a + // SUBSET of products (filtered to that tag). The DOM here doesn't + // contain the rest of the shop, so clicking "All" — or another tag — + // via in-place filter would only ever toggle what's already visible. + // Worse, on the lanes layout (home_layout=2), the unfiltered home is + // a different markup entirely (lanes, not flat grid) — only a full + // navigation can rebuild it. Bail and let chips navigate normally. + const initialParams = new URLSearchParams(window.location.search); + if (initialParams.get("tag")) { + return; + } + const items = grid.querySelectorAll(".serp-item"); function applyFilter(slug) {