Skip to content

Gatsby Scroll Issues on Page Change/Link Click #25522

Closed
@flikteoh

Description

@flikteoh

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

  1. Scroll to bottom of post listing page
  2. Click any links
  3. Notice the next loaded page is scrolled to the bottom like previous page

>>> 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

  System:
    OS: macOS 10.15.5
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.17.0 - ~/.nvm/versions/node/v12.17.0/bin/node
    npm: 6.14.5 - ~/.nvm/versions/node/v12.17.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 83.0.4103.116
    Safari: 13.1.1
  npmPackages:
    gatsby: ^2.23.20 => 2.23.20 
    gatsby-image: ^2.4.12 => 2.4.12 
    gatsby-plugin-mdx: ^1.2.22 => 1.2.22 
    gatsby-plugin-preact: ^4.0.8 => 4.0.8 
    gatsby-plugin-react-helmet: ^3.3.9 => 3.3.9 
    gatsby-plugin-styled-components: ^3.3.9 => 3.3.9 
    gatsby-source-filesystem: ^2.3.18 => 2.3.18 
  npmGlobalPackages:
    gatsby-cli: 2.12.58

Metadata

Metadata

Assignees

Labels

type: bugAn issue or pull request relating to a bug in Gatsby

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions