Skip to content

Commit 4a7a324

Browse files
authored
fix(gatsby): scroll restoration issue in browser API (#27384)
* fix scroll restoration issue * keep the behavior same * fix the lint error
1 parent 43b2f10 commit 4a7a324

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/gatsby/cache-dir/navigation.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ function shouldUpdateScroll(prevRouterProps, { location }) {
128128
// `pathname` for backwards compatibility
129129
pathname,
130130
routerProps: { location },
131-
getSavedScrollPosition: args => this._stateStorage.read(args),
131+
getSavedScrollPosition: args => [
132+
0,
133+
this._stateStorage.read(args, args.key),
134+
],
132135
})
133136
if (results.length > 0) {
134137
// Use the latest registered shouldUpdateScroll result, this allows users to override plugin's configuration

0 commit comments

Comments
 (0)