[object Object]

← back to Patterndesignlab

fix: flush search box into state.q on every load() so typing + clicking a filter keeps the search text (contrarian: search desync)

20e53ca371a6d99dc6a50a9c84bdf3914b0f5d0e · 2026-07-06 10:46:31 -0700 · Steve

Files touched

Diff

commit 20e53ca371a6d99dc6a50a9c84bdf3914b0f5d0e
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jul 6 10:46:31 2026 -0700

    fix: flush search box into state.q on every load() so typing + clicking a filter keeps the search text (contrarian: search desync)
---
 public/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/public/index.html b/public/index.html
index 58e4633..395b710 100644
--- a/public/index.html
+++ b/public/index.html
@@ -96,7 +96,7 @@ function queryFor(pg){
 }
 
 // load() = fresh query (filters/sort/search changed) → reset to page 1, replace grid
-async function load(){ page=1; await fetchPage(false); renderFacets(); }
+async function load(){ const qi=document.getElementById('q'); if(qi) state.q=qi.value.trim(); page=1; await fetchPage(false); renderFacets(); }
 
 // loadMore() = append the next page, keeping the current grid + filters
 async function loadMore(){ if(loading || loaded>=total) return; page++; await fetchPage(true); }

← 2ae1f2e security: stop /api/designers/:slug leaking password_hash+em  ·  back to Patterndesignlab  ·  5x: contrarian gate — correct overclaim, record 3 real defec 4f27d5d →