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

keep-alive缓存页面,dataTable再次激活时所还原的位置不对、不开启虚拟滚动还是会自动滚动到顶部 #2522

Closed
MYxu opened this issue Feb 28, 2022 · 7 comments
Labels
bug Something isn't working priority: high

Comments

@MYxu
Copy link

MYxu commented Feb 28, 2022

TuSimple/naive-ui version (版本)

2.25.5

Vue version (Vue 版本)

3.2.31

Browser and its version (浏览器及其版本)

98.0.4758.102

System and its version (系统及其版本)

win10 (1909)

Node version (Node 版本)

14.15.1

Reappearance link (重现链接)

https://github.com/MYxu/naive-ui-admin-demo

Reappearance steps (重现步骤)

以下步骤的页面都是处于keep-alive组件下

1.1、dataTable开启virtual-scroll
1.2 滚动dataTable,显示第10-20行数据,然后切换到其他页面
1.3 再次切换回dataTable所在页面,会有一定几率显示的是第11-21行数据

2.1 dataTable不开启virtual-scroll
2.2 滚动dataTable,然后切换到其他页面
2.3 再次切换会dataTable所在页面,百分百会滚动回顶部

Expected results (期望的结果)

无论是否开启virtual-scroll,keep-alive组件下,再次切换到dataTable所在页面,dataTable能够正确回滚到对应位置

Actual results (实际的结果)

1、开启virtual-scroll时,dataTable整体下移了一行数据
2、不开启virtual-scroll时,dataTable还是会自动滚动到顶部

Remarks (补充说明)

@github-actions github-actions bot added the untriaged need to sort label Feb 28, 2022
@MYxu
Copy link
Author

MYxu commented Feb 28, 2022

  • bug1:开启virtual-scroll,滚动到第5行数据,切换到其他页面后,再切回来就变成第6行数据了,之后每切换两次都会自动加载下一行数据
    bug1

@MYxu
Copy link
Author

MYxu commented Feb 28, 2022

  • bug2:不开启virtual-scroll,滚动到一定位置,切换到其他页面,然后再切换回来就自动滚动到顶部了
    bug2

@07akioni 07akioni added bug Something isn't working and removed untriaged need to sort labels Feb 28, 2022
@MYxu
Copy link
Author

MYxu commented Apr 2, 2022

@07akioni 大佬冒昧问下,这个bug近期有完全修复的可能吗:joy:

@07akioni
Copy link
Collaborator

07akioni commented Apr 6, 2022

@07akioni 大佬冒昧问下,这个bug近期有完全修复的可能吗😂

不太好说,我尽量早点看看吧,如果经过探索发现问题不大的话会早点修复,尽量这周末抽时间看看看

@07akioni
Copy link
Collaborator

07akioni commented Jun 5, 2022

好了,终于修复了

@07akioni
Copy link
Collaborator

07akioni commented Jun 5, 2022

...真是个持久战

@MYxu
Copy link
Author

MYxu commented Jun 6, 2022

好了,终于修复了

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high
Projects
None yet
Development

No branches or pull requests

2 participants