Skip to content

Commit

Permalink
Merge pull request #2190 from inertiajs/fix-scroll-restoration-ssr
Browse files Browse the repository at this point in the history
Fix SSR with scroll restoration
  • Loading branch information
joetannenbaum authored Jan 15, 2025
2 parents cad9213 + 87f465a commit 37bae9c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 53 deletions.
90 changes: 38 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/src/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class History {
}
}

if (window.history.scrollRestoration) {
if (typeof window !== 'undefined' && window.history.scrollRestoration) {
window.history.scrollRestoration = 'manual'
}

Expand Down

0 comments on commit 37bae9c

Please sign in to comment.