From 3460d54fceb111600c7726651c5367c88a538649 Mon Sep 17 00:00:00 2001 From: fen Date: Thu, 17 Sep 2026 20:30:04 -0500 Subject: [PATCH] Fix #282: re-evaluate jumpnav visibility after layout settles on load The initial refresh() ran before the mobile layout settled (media queries, fonts, async highlighting) and under-measured the content, leaving #jumpnav hidden on long pastes at 375x812 until a resize event. Re-check after a double rAF, on window load, after 300ms, and via a ResizeObserver on document.body for late content growth. Editor textarea scroller unchanged. --- internal/web/static/jump.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/web/static/jump.js b/internal/web/static/jump.js index 03fb611..cb1574b 100644 --- a/internal/web/static/jump.js +++ b/internal/web/static/jump.js @@ -38,4 +38,14 @@ window.addEventListener('resize', refresh); if (scroller !== window && scroller) scroller.addEventListener('input', refresh); refresh(); + /* #282: the first evaluation can run before the layout settles (media + queries, web fonts, async highlighting) and under-measure the content, + leaving the nav hidden on long pages. Re-check once a real layout exists + and after load; the ResizeObserver also catches late content growth. */ + requestAnimationFrame(function () { requestAnimationFrame(refresh); }); + window.addEventListener('load', refresh); + window.setTimeout(refresh, 300); + if (window.ResizeObserver && scroller === window && document.body) { + new ResizeObserver(refresh).observe(document.body); + } })();