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

Keep model when navigating back #384

Open
Redsandro opened this issue Jul 4, 2019 · 2 comments
Open

Keep model when navigating back #384

Redsandro opened this issue Jul 4, 2019 · 2 comments

Comments

@Redsandro
Copy link
Contributor

When navigating back, I observe that all previously appended results are gone, and I end up scrolled back to the top where the first set of results are shown.

Is it possible to keep all the models, and when going "back", I go back to the page including all appended and autoloaded records?

Current behavior

  • Visit infinity page, initially 50 items
  • Scroll down
  • Load a bunch of new pages; say 250
  • Click item 250 - this changes route
  • Go back to the previous page
  • Only first 50 items are shown

Trying to achieve the following:

  • Visit infinity page, initially 50 items
  • Scroll down
  • Load a bunch of new pages; say 250
  • Click item 250 - this changes route
  • Go back to the previous page
  • 250 items are shown, scrolled down
@Redsandro
Copy link
Contributor Author

Redsandro commented Aug 28, 2019

Going "back" to an infinite scroll list after clicking on an item also causes OSX Safari to freeze for some seconds, and show number 200+ while secretly being reset to the first results. So if you click on (for example) number 240, it will open number 40 as if you clicked on 40. Safari Version 12.1 (14607.1.40.1.4)

@Redsandro
Copy link
Contributor Author

@hhff commented:

the infinityModel method always assumes that you're starting from 0.

Perhaps a shouldFlushInfinityModel hook (or similar) could be the solution here! If you'd like to take a stab at that, we'd very much appreciate it.

So Safari has this back/forward cache that when going back always assumes you're starting from exactly the state where you left off. How do other people deal with this?

This seems to be the opposite problem.

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

No branches or pull requests

1 participant