Skip to content

Navigating back should retain the scroll position. #1669

@krestaino

Description

@krestaino

Version

2.7.0

Reproduction link

https://github.com/krestaino/nuepress

Steps to reproduce

  1. Go to http://localhost:3000/
  2. Scroll down and click on a post
  3. After the new page loads, use the browser's back button
  4. Scroll position goes to the top rather than where it was

What is expected?

Navigating back should retain the scroll position.

What is actually happening?

Navigating back does not retain the scroll position.

Related Issues

nuxt/nuxt#1036
#1373

nuxt/nuxt#1182 (this issue on nuxt/nuxt.js)


Is this a vue-router or Nuxt.js issue?

One thing I noticed, if I set the height of the HTML element to something like html { min-height: 10000px }, the issue goes away. Is this happening because the post list is being rendered dynamically using v-for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions