Version: @tanstack/redact 0.2.0, TanStack Start 1.169 / Router 1.170, Cloudflare Workers
installHydrationScrollGuard (src/dom/features/hydration/full.ts) wraps window.scrollTo. For 3 s after hydration it drops every call made within 1.5 s of a user scroll. That includes TanStack Router's scrollTo({ top: 0 }) on client navigation.
Repro: load a long page, scroll down, click a link to another route within ~1 s.
- React: the new page starts at
scrollY = 0.
- Redact: the new page opens near the old scroll position (1527 → 1368 in our Playwright test). Clicking 2 s or later after the scroll works.
Visitors do exactly this on landing pages: scroll fast, click a footer or nav link.
Workaround we ship in production: <script>window._r=1</script> in <head>, so the guard skips installing.
Could the guard only drop scrolls that happen during hydration, or stand down once the router handles a navigation? A feature flag would also work.
Thanks for reporting this. The hydration scroll guard was removed in #76, released in 0.2.1, so this looks fixed. I'm closing it out, but please reopen this or send a fresh reproduction if navigation still keeps the old scroll position on 0.2.3.