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

Hitting the back button takes you back to first page #679

Closed
fschroiff opened this issue Jun 30, 2017 · 5 comments
Closed

Hitting the back button takes you back to first page #679

fschroiff opened this issue Jun 30, 2017 · 5 comments
Labels

Comments

@fschroiff
Copy link

fschroiff commented Jun 30, 2017

Test case: https://infinite-scroll.com/demo/full-page/
Browser: Safari 10.1.1 (12603.2.4)

  • Scroll until the URL changes (.../page2.html)
  • click on an external link
  • hit the browser's back button

You are now back on https://infinite-scroll.com/demo/full-page/

I expected to be taken back to .../page2.html

@desandro
Copy link
Member

desandro commented Jun 30, 2017

Thanks for reporting this bug. Looks like there's a race condition with how Infinite Scroll re-sets scroll position before loading a page, and how Infinite Scroll watches scroll position to set page.

The fix will be in the next release of Infinite Scroll.

@desandro desandro reopened this Jun 30, 2017
@desandro desandro added the bug label Jun 30, 2017
@franszo
Copy link

franszo commented Jul 6, 2017

Hi @desandro
all the respect for your work on this! this is well waited feature!
I have to say, its the same story for me, scrolling down to X pages, and clicking an external URL, makes the URL to original, then opening the new link. This is also happening on your fullpage demo
https://infinite-scroll.com/demo/full-page/

just another note : implemented into WP, where next link is /page/2, once this applied to the url, and going back to it, this only loads the contents of that exact page, not the original page and scrolling down to the 2nd loaded. Any other way to store the loaded page with a # or a ? so its not loading that exact page back?

Big up for your work!

@desandro
Copy link
Member

desandro commented Jul 6, 2017

@franszo Thanks for reporting this issue. To your another note, this is how Infinite Scroll's history option is designed to work. I feel this is an elegant solution that holds up even with JavaScript disabled. There is no feature that will allow you to re-establish previous infinite scroll state with multiple pages loaded. I feel this kind of feature is overly complex.

@franszo
Copy link

franszo commented Jul 7, 2017

@desandro
Thanks for quick reply. I personally thought its storing that I scrolled down until page6 for example, and on going back, its loading up all the pages up to page6. This would be the absolute best, or keeping this behaviour, but when going back to your page, scrolling up, would load and prepend the previous page? Just thinking out loud.

@desandro
Copy link
Member

desandro commented Aug 4, 2017

v3.0.1 has been released with this fix added. Please update! Closing this issue has resolved 🌈🐻

@desandro desandro closed this as completed Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants