You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
Describe the bug
When calling goto from your code, when the page is scrolled such that the top of it is off screen, and navigating to an equally long page, the scroll position is not reset to 0, even if the page has not been visited before.
To Reproduce
Create two pages of 200% length with a button at the bottom. Cause the button to call goto passing the next page as a parameter.
Expected behavior
I would expect goto to default to scrolling the page to the top on navigation, especially if the page has not been visited before.
Information about your Sapper Installation:
Google Chrome | 80.0.3987.132 (Official Build) (64-bit)
OS | Linux
Sapper version (Please check you can reproduce the issue with the latest release!)
0.27.11
Svelte version (Please check you can reproduce the issue with the latest release!)
3.20.1
If it is an exported (npm run export) or dynamic application.
Dynamic
Whether your application uses Webpack or Rollup
Rollup
Severity
I can work around it with:
await goto('/some-page')
window.scrollTo(0, 0)
so not too critical.
The text was updated successfully, but these errors were encountered:
I’ve noticed that the scroll position does not get set to the top after redirecting with this.redirect. I’ll make a separate issue and repro; not sure it’s related to the OP here
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
When calling goto from your code, when the page is scrolled such that the top of it is off screen, and navigating to an equally long page, the scroll position is not reset to 0, even if the page has not been visited before.
To Reproduce
Create two pages of 200% length with a button at the bottom. Cause the button to call
goto
passing the next page as a parameter.Expected behavior
I would expect goto to default to scrolling the page to the top on navigation, especially if the page has not been visited before.
Information about your Sapper Installation:
Google Chrome | 80.0.3987.132 (Official Build) (64-bit)
OS | Linux
0.27.11
3.20.1
Dynamic
Rollup
Severity
I can work around it with:
so not too critical.
The text was updated successfully, but these errors were encountered: