-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
VirtualScroll listview jumps to beginning if object of items has been changed #7056
Comments
My use case - deleting an item from the array, even without navigating from the list. |
It also makes virtualscroll unusable with infinitescroll, as it jumps to the top when new items are fetched |
Perhaps slightly related: #6787 |
It is related to #6423. |
Hello everyone! Thanks for using Ionic! We have been hard at work lately with virtualscroll. The issue here is that when you update the virtualscroll with data after it has already been rendered the measurements that virtual scroll uses to lazily render elements then become wrong. When this happens the virtual scroll has to re-render itself entirely, therefore making it look like it has jumped back to the beginning of the list. We are well aware of this issue and hope to have a solution for it soon. Also, just to keep our issues concise and not have duplicates I am going to close this one as a duplicate of #6423 . You can track the status of this issue over on that issue. Also, feel free to put any findings you may have on that issue. Thanks again everyone! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Short description of the problem:
VirtualScroll is, as it was in ionic1 badly implemented without being properly tested with different usecases. This issue assumes you have a listview using VirtualScroll. One element is ion-item which has click event leading you to details page of that element.
On details page, you change the single object of your array of elements, being show in VirtualScroll.
Going back from the details page to virtualscrollview will always lead you to being at the top of the virtualscroll and will not remember the positioning, since the object has been changed.
So if you would click on element 51 out of 1000, then come back, you will see that you're starting at the top of the view again and not at element 51, which leads to usage of VirtualScroll being unusable. Similar issue/behavior has also been reported on the forums (https://forum.ionicframework.com/t/virtual-scroll-remove-or-hide-item-without-reset-lost-scroll-position/54024/9), but without any official replies.
What behavior are you expecting?
Clicking element 51, navigating to details page of element 51, clicking back would lead you to exact same position you were before.
Steps to reproduce:
Which Ionic Version? 1.x or 2.x
Ionic Version 2 beta9
Run
ionic info
from terminal/cmd prompt: (paste output below)The text was updated successfully, but these errors were encountered: