From c8ccb80f2f5bdb73e7fe72fa1882bd48fe0be456 Mon Sep 17 00:00:00 2001 From: Honey Date: Wed, 27 May 2026 13:04:34 +0200 Subject: [PATCH] fix: header search overlay clipping and mobile fit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change overlay from position:absolute to position:fixed so it isn't clipped by main-content's overflow-y:auto - Set overlay top dynamically from header.offsetHeight so it always anchors exactly below the sticky header - Responsive max-height: accounts for player bar + bottom nav on mobile - Hide logo text on ≤359px screens to keep search pill wide enough Co-Authored-By: Claude Sonnet 4.6 --- index.html | 2 +- src/views.js | 7 ++++++- styles.css | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 9be13a3..8eeb9bf 100644 --- a/index.html +++ b/index.html @@ -123,7 +123,7 @@ - diff --git a/src/views.js b/src/views.js index 1460ad3..db15fa8 100644 --- a/src/views.js +++ b/src/views.js @@ -1017,7 +1017,12 @@ export function onHeaderSearch(val) { if (clearBtn) clearBtn.style.display = val ? 'block' : 'none'; clearTimeout(S._headerSearchTimer); if (!val.trim()) { if (overlay) overlay.style.display = 'none'; return; } - if (overlay) overlay.style.display = 'block'; + if (overlay) { + // position:fixed — anchor top to actual header bottom so it works with any header height + const header = document.getElementById('mobile-header'); + if (header) overlay.style.top = header.offsetHeight + 'px'; + overlay.style.display = 'block'; + } const el = document.getElementById('header-search-results'); S._headerSearchTimer = setTimeout(() => doLocalSearch(val, el), 300); } diff --git a/styles.css b/styles.css index d2d6db3..f83fa62 100644 --- a/styles.css +++ b/styles.css @@ -69,6 +69,10 @@ html.ns-authed #setup-screen{display:none} .header-search-wrap input{flex:1;min-width:0;background:none;border:none;outline:none;color:var(--text);font-family:var(--font);font-size:14px} .header-search-wrap input::placeholder{color:var(--text3)} +#header-search-overlay{position:fixed;left:0;right:0;background:var(--bg);border-bottom:1px solid var(--border);box-shadow:0 12px 32px rgba(0,0,0,.5);padding:6px 12px 20px;z-index:11;overflow-y:auto;max-height:calc(100vh - 120px)} +@media(max-width:768px){#header-search-overlay{max-height:calc(100vh - var(--player-h) - 160px)}} +@media(max-width:359px){#mobile-header .sidebar-logo span{display:none}} + nav{flex:1;overflow-y:auto;padding:4px 10px} .nav-section{margin-bottom:18px} .nav-section-title{font-size:10px;font-weight:600;letter-spacing:1px;text-transform:uppercase;color:var(--text3);padding:0 8px;margin-bottom:3px}