diff --git a/app/tournaments/[year]/client.tsx b/app/tournaments/[year]/client.tsx index 724e06b..2d45376 100644 --- a/app/tournaments/[year]/client.tsx +++ b/app/tournaments/[year]/client.tsx @@ -76,8 +76,11 @@ export function TournamentClient({ params }: { params: Promise<{ year: string }> if (!data) return const hash = window.location.hash if (!hash) return - const el = document.getElementById(hash.slice(1)) - if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' }) + // double-rAF: first frame commits React's DOM, second frame lets the browser lay out + requestAnimationFrame(() => requestAnimationFrame(() => { + const el = document.getElementById(hash.slice(1)) + if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' }) + })) }, [data]) @@ -162,7 +165,7 @@ export function TournamentClient({ params }: { params: Promise<{ year: string }>