Currently by default across my app I get this issue.
- Visit a new page on the site
- Once the page has loaded most of the content, start scroll down.
- Page seems to finish loaded.. and there's an undesired snap back to the top of the page.
- User experiences a jank/jerk, looses their place and then needs to start scrolling again.
From initial web searches it seems it could be one of a few issues.
Seems not to be image or font loading as I initially thought.
Then I came across the Nuxt scrollToTop Property which seems to be the culprit.
I changed the code on each of my pages following the documentation.
Attempts to set this in my layout was unsuccessful but adding it to each page in my site worked to address THIS problem and I've currently taken this approach to stop the jank snap back effect.
<template>
<h1>My child component</h1>
</template>
<script>
export default {
scrollToTop: false
}
</script>
Now however I'm getting a weird second issue..
Page keeps loading a place half way down the page when I click across pages
With scrollToTop: false
I'm now getting this effect..
- Load site see top of page
- Scroll say 3/4 way down.. and click button to say /second-page.
- Second Page loads showing (loosely) position 3/4 way down
- User confused in a new way now as they can visit pages for the first time in the site and never see the header for that page.
- Im happy if the user visits a page and say scrolls 80% down the page, and leaves and comes back to the page and it's still 80% of the way down. That feels justifiably expected. But not just navigating across the site in a weird 3/4 way down page state.
Help! So confused.
How to I load new pages at the top of the page and NOT have the snap back to top occur if the user has already started scrolling.. you know get normal occurrence like native navigation on a static site.