quasar icon indicating copy to clipboard operation
quasar copied to clipboard

Keep scroll position on page change

Open mlenormand opened this issue 10 years ago • 5 comments

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

mlenormand avatar Sep 03 '16 17:09 mlenormand

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

rstoenescu avatar Sep 03 '16 18:09 rstoenescu

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

rstoenescu avatar Mar 30 '17 07:03 rstoenescu

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 ...

danikane avatar Apr 03 '17 11:04 danikane

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.

spectrolite avatar Jun 22 '17 16:06 spectrolite

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

rstoenescu avatar Oct 20 '17 18:10 rstoenescu