diff --git a/app/src/components/RootLayout.tsx b/app/src/components/RootLayout.tsx index df5595124d..7f04c7048a 100644 --- a/app/src/components/RootLayout.tsx +++ b/app/src/components/RootLayout.tsx @@ -49,6 +49,13 @@ export function RootLayout() { window.scrollTo(0, 0); }, [pathname, hash, navigationType]); + // Always reset horizontal scroll on route change. If a previous page leaked + // page-level horizontal scroll (e.g. a wide table on mobile), the offset + // otherwise persists into the next page and clips its left edge. + useEffect(() => { + window.scrollTo({ left: 0, top: window.scrollY }); + }, [pathname]); + return (