Hey @ryanwiemer — I've been using bits of your code from this example to implement page transitions on my Gatsby projects and it works great!
I've noticed in the last few months is that scroll restoration no longer works on popstate, despite this logic:
|
export const shouldUpdateScroll = ({ |
|
routerProps: { location }, |
|
getSavedScrollPosition |
|
}) => { |
|
if (location.action === "PUSH") { |
|
window.setTimeout(() => window.scrollTo(0, 0), transitionDelay); |
|
} else { |
|
const savedPosition = getSavedScrollPosition(location); |
|
window.setTimeout( |
|
() => window.scrollTo(...(savedPosition || [0, 0])), |
|
transitionDelay |
|
); |
|
} |
|
return false; |
|
}; |
I was wondering if you'd come across that issue and had any thoughts on a workaround.
Possibly related to this issue: gatsbyjs/gatsby#23842 ?
Hey @ryanwiemer — I've been using bits of your code from this example to implement page transitions on my Gatsby projects and it works great!
I've noticed in the last few months is that scroll restoration no longer works on popstate, despite this logic:
gatsby-using-page-transitions/gatsby-browser.js
Lines 10 to 24 in c4a5226
I was wondering if you'd come across that issue and had any thoughts on a workaround.
Possibly related to this issue: gatsbyjs/gatsby#23842 ?