ivanvanderbyl / ember-hackernews-pwa

An Ember implementation of the HackerNews client as a Progressive Web App
https://hackernews.io
62 stars 14 forks source link

Remember scroll position when switching between categories #8

Closed kiwi-josh closed 7 years ago

kiwi-josh commented 7 years ago

Currently when the user switches between categories their last scroll position is lost, which makes for a frustrating user experience.

This PR saves the scroll position of each category when leaving the route (willTransition), and then restores it on re-entry.

The exception is the item route, which will now always returns to the top to begin reading.