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

VirtualScroll listview jumps to beginning if object of items has been changed #7056

Closed
lordgreg opened this issue Jun 26, 2016 · 6 comments
Closed

Comments

@lordgreg
Copy link

lordgreg commented Jun 26, 2016

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:

  1. VirtualScroll with 1000 elements (even 50 if you wish)
  2. Click element 51 and use nav.push to go to the other page
  3. Edit 1 element in list
  4. Press back
  5. Where are you taken? Exactly, top of the VirtualScroll page.

Which Ionic Version? 1.x or 2.x
Ionic Version 2 beta9

Run ionic info from terminal/cmd prompt: (paste output below)

$ ionic info

Your system information:

You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.2.0

Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.9
Ionic CLI Version: 2.0.0-beta.31
Ionic App Lib Version: 2.0.0-beta.17
OS:
Node Version: v5.9.1
@lordgreg lordgreg changed the title VirtualScroll listview jumps to beginning when doing nav.push for each element and then going back VirtualScroll listview jumps to beginning if object of items has been changed Jun 26, 2016
@beck24
Copy link

beck24 commented Jun 26, 2016

My use case - deleting an item from the array, even without navigating from the list.

@beck24
Copy link

beck24 commented Jun 26, 2016

It also makes virtualscroll unusable with infinitescroll, as it jumps to the top when new items are fetched

@mpaland
Copy link

mpaland commented Jun 26, 2016

Perhaps slightly related: #6787

@DomiR
Copy link
Contributor

DomiR commented Sep 8, 2016

It is related to #6423.

@jgw96
Copy link
Contributor

jgw96 commented Dec 28, 2016

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!

@jgw96 jgw96 closed this as completed Dec 28, 2016
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 5, 2018

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants