Skip to content

Commit b15a846

Browse files
Miguel Gonzalezmjackson
authored andcommitted
Evaluate if prevLocation is null
1 parent 26400c1 commit b15a846

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/ScrollManagementMixin.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ function shouldUpdateScrollPosition(state, prevState) {
1212
var { location, branch } = state;
1313
var { location: prevLocation, branch: prevBranch } = prevState;
1414

15+
// On browser load, when having an onEnter event with a redirect
16+
// on the transition prevLocation is null, so assume we don't
17+
// want to update the scroll position
18+
if (prevLocation === null)
19+
return false;
20+
1521
// Don't update scroll position if only the query has changed.
1622
if (location.pathname === prevLocation.pathname)
1723
return false;

0 commit comments

Comments
 (0)