Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Highway example bug #55

Closed
iamlinkus opened this issue May 14, 2021 · 2 comments
Closed

Highway example bug #55

iamlinkus opened this issue May 14, 2021 · 2 comments

Comments

@iamlinkus
Copy link

My team started a project with ASScroll and we're using it with Highway from Dogstudio.

We've encountered a bug where if the user scrolls down on a page and then refreshes the page, immediatelly after the refresh, the page scrolls down to the last position it was before the refresh. We thought it was a bug in our end, but after further research, forked the PJAX example (linked in the readme) and it does the exact same thing.

Here's a video illustrating the problem: https://cln.sh/PzSspZ

@ashthornton
Copy link
Owner

Native browser scrolling will restore the previous position after a refresh or via browser back/forward history buttons which is what causes this. I usually disable this with:

if ('scrollRestoration' in window.history) {
    window.history.scrollRestoration = 'manual'
}

I do think ASScroll should just start at that previous position, rather than lerp to it though. So I'll update that.

@iamlinkus
Copy link
Author

Was trying to figure this out yesterday and came to the same conclusion, thanks!

And I agree that ASScroll should not lerp in that specific scenario. Thanks for fixing it!

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

No branches or pull requests

2 participants