-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gatsby Scroll Issues on Page Change/Link Click #25522
Comments
Noticing the behavior to happen to internal links that are not created via Gatsby Link, ie: a markdown/mdx link or regular tags. The new scroll states were not created when changing a page, initial scroll state were updated instead. Is this the intended behavior? Note: Using |
Update: Using Gatsby Link also causes the next page click not to update page template. |
Got the same issue here as well |
Could be also related: #25554 |
It appears that this bug has been introduced here - #24306 and released in 2.23.6 (2020-06-19) (see https://github.com/gatsbyjs/gatsby/compare/[email protected]@2.23.6). I tried downgrading to 2.23.5, but this didn't help, which makes me think that my identified source of error isn't the culprit. I tried downgrading to other lower versions, but ran into various issues (I reported them here - #25607) If you are like me and you have [email protected] or similar and you just want to upgrade to most recent version without aforementioned issues, then the following will work for you:
NOTE: this above syntax (
And that's it. You can find a bit more detail on this here - #25478 (comment) |
The same issue after migration from v3 to v4 Gatsby. Can someone give an advice how to fix it or should I better stay on v3 version? |
This is solution: Put this code to your gatsby-browser: export const shouldUpdateScroll = ({ routerProps: { location }, getSavedScrollPosition }) => { That's it. |
Hi, I've tried searching for half a day and couldn't get a solution and I'm not sure if it is related to #24306 ?
Description
When clicking a link on front page with a list of posts after scrolling down for example, would result in the new content being scrolled down as much as previous page.
At first I have read many other posts and issues mentioning it was related to css / body height etc but could not find a solution to this.
I have setup Gatsby completely from scratch to reconfirm my problem is not related to css.
Things seems to work fine in development mode. This happens on production
Steps to reproduce
>>> Minimal Reproduction
Expected result
After scrolling down from index page, the link click should load a new page, with the view at top.
Actual result
New page is loaded at the scrolled location of previous page
Environment
The text was updated successfully, but these errors were encountered: