Skip to content
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

Scroll should be at the top when you navigate to a new page. #3119

Closed
mariopino opened this issue Nov 12, 2019 · 1 comment · Fixed by #3120
Closed

Scroll should be at the top when you navigate to a new page. #3119

mariopino opened this issue Nov 12, 2019 · 1 comment · Fixed by #3120
Assignees

Comments

@mariopino
Copy link
Contributor

Describe the bug

When open a large page that is taller than browser viewport, scroll down the page, open another large page throught menu, you will find that the scroll is at the bottom of the new page.

To Reproduce

  1. Open Lunie, and resize the window so it's less than 1024 px width.
  2. Open top menu and click on Security.
  3. Scroll down the page
  4. Open top menu and click on Careers.
  5. The Careers page have the scroll at the bottom of the page.

Expected behavior

Scroll should be at the top when you navigate to a new page.

Additional context

We should reset scrolling when detecting a route change.

@mariopino mariopino self-assigned this Nov 12, 2019
@mariopino
Copy link
Contributor Author

This is already implemented, but for some reason it does not working :-(

const router = new Router({
  mode: process.env.VUE_APP_E2E ? undefined : "history",
  scrollBehavior: () => ({ y: 0 }),
  routes
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant