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

[BUG] unexpected behavior under keep-alive component #161

Closed
FrameJ opened this issue Jan 13, 2020 · 9 comments
Closed

[BUG] unexpected behavior under keep-alive component #161

FrameJ opened this issue Jan 13, 2020 · 9 comments
Labels

Comments

@FrameJ
Copy link

FrameJ commented Jan 13, 2020

When routes changed under a keep-alive-router-view component, the scroll position of Virtual-List will be reseted, but its contents keep old state, so I will see a blank area in my list before I scroll it again.

@tangbc
Copy link
Owner

tangbc commented Jan 13, 2020

Can you give a example repo ov codepen so I can deal with it?

@tangbc tangbc added the bug label Jan 13, 2020
@FrameJ
Copy link
Author

FrameJ commented Jan 13, 2020

here is the demo: https://jsfiddle.net/za9cxsk8/

@rkuzemsky-softonix
Copy link

rkuzemsky-softonix commented Feb 27, 2020

here is the demo: https://jsfiddle.net/za9cxsk8/

Hi everyone.
This issue happens because the virtual-list component does not save the scrollTop value. And on activated hook it is 0. So I found a quick solution to just set it via ref.
This is working example - https://jsfiddle.net/d46jmy2z/1/

@tangbc
Copy link
Owner

tangbc commented Apr 3, 2020

I'll try to keep the position when activated again use with keep-alive.

@tangbc tangbc added the planning label Apr 3, 2020
@fenghuijiuzhuan
Copy link

I had the same problem

@tangbc
Copy link
Owner

tangbc commented Apr 13, 2020

Do you expect to keep scroll position or reset to init state?

@fenghuijiuzhuan
Copy link

fenghuijiuzhuan commented Apr 13, 2020

I want it to stay in its current scrolling position, but it goes back to the top and the page is blank,just like #161 (comment)

@tangbc
Copy link
Owner

tangbc commented Apr 17, 2020

Now in v2.0.5 support a reset method, keep previous position is under developping.

@tangbc
Copy link
Owner

tangbc commented Apr 19, 2020

Fixed and published in v2.0.7

@tangbc tangbc closed this as completed Apr 19, 2020
@tangbc tangbc removed the planning label Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants