Quasar: Keep scroll position on page change

Created on 3 Sep 2016  路  5Comments  路  Source: quasarframework/quasar

We are on page A, go to page B and then go back to page A. The scroll position is not restored.
Not a bug but I think it's a useful feature for an SPA framework.
Found this project that implements this feature : https://github.com/mark-hahn/vue-keep-scroll

Most helpful comment

On v0.14 when using vue router's history mode this will work by default.

All 5 comments

Will try to research this one and if I'm successful and I have enough time I'll inject this into v0.7.

On v0.14 when using vue router's history mode this will work by default.

The scroll position feature using the custom directive above works, however it may cause some issues in a more complex SPA.
I've tried it with mixed success. Then again it could be my implementation that's problematic :)
Unfortunately vue-router's hash mode doesn't support this, therefore Cordova builds don't either ...

Can we have any way to control this behaviour ?
I see how it can be useful in many cases. But I've already encountered a couple cases where it is not desirable (in the same app). It would be great if we could toggle this behaviour easily either at the router level, or even (better than nothing) at the page/component level.

Available in v0.14 along with Vue Router 3.x and the scrollBehavior router prop.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xereda picture xereda  路  3Comments

danikane picture danikane  路  3Comments

wc-matteo picture wc-matteo  路  3Comments

alexeigs picture alexeigs  路  3Comments

nueko picture nueko  路  3Comments