3 ms·
> usually breaks the back button (e.g. scroll to the 20th page, click something, go back. welcome to page 1!) This is easily overcome by pushState or what have
by Viper007Bond 11y ago
> usually breaks the back button (e.g. scroll to the 20th page, click something, go back. welcome to page 1!)
This is easily overcome by pushState or what have you. As you scroll, the URL in the address bar changes to like `/page/20/` and then going back takes you to that URL where only the results from page 20 are displayed.
- Groxx 11y agoThis works fairly well in a lot of cases, and I definitely prefer it over page 1. But if you do that, you can't scroll up to see page 19 - you didn't really go back, you were just brought to a one-time page to see that thing you looked at most recently in a massive list. What if you were comparing things on page 17 and 20? Another approach is with "virtual scrolling", by preserving space for the items above and loading whatever you scroll to - I've seen that once (I forget where) and it was really nice. They didn't tackle the linkability problem tho, and had other issues. But all of this is fairly complex, and very few sites (or apps!) actually do so. Which is part of the problem.