← back to Designer Wallcoverings
dw-boost-overrides: fix re-mount target check — append to visible toolbar-inner instead of contains()-rejecting it (slider was lifted out of hidden --3_1)
4fec42078eabd9fd29a852532521d906c0b7ca6a · 2026-06-27 17:03:18 -0700 · Steve Abrams
Files touched
M shopify/theme-files/snippets/dw-boost-overrides.liquid
Diff
commit 4fec42078eabd9fd29a852532521d906c0b7ca6a
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Sat Jun 27 17:03:18 2026 -0700
dw-boost-overrides: fix re-mount target check — append to visible toolbar-inner instead of contains()-rejecting it (slider was lifted out of hidden --3_1)
---
.../theme-files/snippets/dw-boost-overrides.liquid | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/shopify/theme-files/snippets/dw-boost-overrides.liquid b/shopify/theme-files/snippets/dw-boost-overrides.liquid
index d823fed8..a83ebbd7 100644
--- a/shopify/theme-files/snippets/dw-boost-overrides.liquid
+++ b/shopify/theme-files/snippets/dw-boost-overrides.liquid
@@ -439,17 +439,26 @@ body.dw-filters-collapsed .boost-sd__product-list[class*="grid--"]{grid-template
tries = tries || 0;
/* If our slider is already visible to the user, nothing to do. */
if (isShownEl(sliderWrap)) return;
- /* Find the toolbar container Boost is actually displaying (same selector
- set the color-sort pill resolves against), and make sure it isn't the
- hidden row our controls are currently in. */
+ /* The slider/toggle/ptype were anchored next to the product-count item,
+ which lives inside the HIDDEN .boost-sd__toolbar--3_1 row. The VISIBLE
+ container Boost actually paints is .boost-sd__toolbar-inner (the same one
+ the color-sort pill resolves to and mounts as a DIRECT child of — proven
+ live). Note: that inner is an ANCESTOR of the hidden --3_1, so a naive
+ .contains(slider) check is true even though the slider isn't visible — do
+ NOT reject the target on contains(); instead append our controls as DIRECT
+ children of the visible inner, which LIFTS them out of the hidden --3_1. */
var inners = [].slice.call(document.querySelectorAll(
'.boost-sd__toolbar-inner, .boost-sd__toolbar-content'));
var target = null;
for (var i = 0; i < inners.length; i++){
- if (isShownEl(inners[i]) && !inners[i].contains(sliderWrap)) { target = inners[i]; break; }
+ /* skip an inner whose DIRECT child is already our slider (== it's visible,
+ we'd have returned above) — but accept a visible inner that only
+ transitively contains the slider via the hidden --3_1 row. */
+ if (isShownEl(inners[i]) && sliderWrap.parentElement !== inners[i]) { target = inners[i]; break; }
}
if (target){
- /* Move (not clone) so all wired event listeners + state come along. */
+ /* Move (not clone) so all wired event listeners + state come along.
+ appendChild relocates them out of the hidden --3_1 into the visible inner. */
target.appendChild(btn);
target.appendChild(sliderWrap);
target.appendChild(ptypeBar);
← 0f8a6b79 dw-boost-overrides: re-mount density slider+filter toggle+pt
·
back to Designer Wallcoverings
·
auto-save: 2026-06-27T17:10:09 (3 files) — pending-approval/ cc98d168 →