[object Object]

← back to Ffepurchasing

search: scroll results into view on mobile (grid was below the fold → looked like nothing happened)

ae481a9db06cf7aa47ae69117b890bd0586cf0f3 · 2026-07-30 10:05:36 -0700 · Steve Abrams

Files touched

Diff

commit ae481a9db06cf7aa47ae69117b890bd0586cf0f3
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Jul 30 10:05:36 2026 -0700

    search: scroll results into view on mobile (grid was below the fold → looked like nothing happened)
---
 public/index.html | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/public/index.html b/public/index.html
index 7ab12e8..845e5b4 100644
--- a/public/index.html
+++ b/public/index.html
@@ -780,7 +780,12 @@ io.observe(document.getElementById('sentinel'));
 document.getElementById('searchInput').addEventListener('input', e => {
   state.q = e.target.value.trim();
   clearTimeout(window._t);
-  window._t = setTimeout(resetGrid, 220);
+  window._t = setTimeout(() => {
+    resetGrid();
+    // Mobile: results grid sits below the fold under the keyboard, so a search looks
+    // like "nothing happened". Bring results into view when a query is entered.
+    if (state.q) { const a = document.getElementById('statLine') || document.getElementById('grid'); if (a) a.scrollIntoView({ behavior: 'smooth', block: 'start' }); }
+  }, 220);
 });
 
 // Density slider — at the lowest setting (4 cols) auto-flip to table view (B2B trade-portal default).

← 848b485 corner-nav: block javascript:/data: URIs in search preview (  ·  back to Ffepurchasing  ·  ffepurchasing: adopt href-to-deeper-data primitives (TK-1009 23394bf →