Skip to content

Commit 240ffc6

Browse files
Vojtěch Václav Portešvojtechportes
authored andcommitted
fix: Restored scroll position on library website on path change
1 parent b823d9a commit 240ffc6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

example/src/components/site-shell.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ export const SiteShell: React.FC = () => {
325325
const location = useLocation();
326326
const year = new Date().getFullYear();
327327

328+
React.useEffect(() => {
329+
window.scrollTo({ top: 0, left: 0 });
330+
}, [location.pathname]);
331+
328332
React.useEffect(() => {
329333
setMobileMenuOpen(false);
330334
}, [location.pathname]);

0 commit comments

Comments
 (0)