-
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
Ionic 2 beta 11 virtual scroll and infinite scroll autoscrolls up after update #8037
Comments
Yes I confirm, it's a bug inherited from ionic1 by the way. I've not had time to log it . In my infinite scrolls when I load a video from the (ionInfinite)="doInfinite($event)" the ion-content goes back up automatically when video is finished and comes back to the view. thanks @theromis !!! |
any plans to fix that? |
Hi,
So you either remove this line, or you could just scroll back to the position you want after completing the reload. You can play around with those values. |
Just tried the first solution by removing the scrollTop line, it does not show data until you change scroll position. And as for 2nd solution how can we get the scroll position before loading as in variable scrollHeight? |
yeah correct. As a workaround you could try 2nd solution: I guess it only shows scroll items after loading when you scroll down a bit ? (if you scroll up it doesn't show) To get the scroll position: |
We need to made some more changes just removing |
And i think this line has nothing to do with items not showing until you scroll down a bit after loading is done with infinite scroll. do share your thoughts on that. |
Just found the solution so it appears Solution: there as it was being done in updateScroll. It seems to work perfectly when i have used VirtualScroll+InfiniteScroll+PullToRefresh altogether. Now just need someone to test it on android, and someone who can test its performance. Thank you so much @lujakob you have been a massive help. |
@azzamasghar I've tried your solution and unfortunately the perfomance on scrolling is really bad |
Yeah its not feasible i am also stuck here. |
Hey, lots of questions about this on forums and articles about virtual scroll. Any update on that? This is a must-have in many applications. Wonder how would be an Ionic's Twitter without infinite scrolling, loading tons of useless data, or without virtualscroll leaving tons of useless data behind as you scroll... |
The current state for my application is a modified ion-infinite-scroll. I duplicated the code of the ionic component and named it my-infinite-scroll and changed the code that I basically get notified if I scroll to the bottom or top. I have a property 'arrivedAt' telling me if it's top or bottom. Also I find out about the first visible item in the list at the time of the reload. I replace my list items and scroll to the position where first visible item from before was. |
+1. This is a must fix defect. please ionic fix this. we desperately need an official solution on this bug. |
@lujakob can you please share you custom solution source code if possible |
I will try to find some time in the next couple of days to set up a public repository with a simple demo of my solution. |
Hey guys, I set up a repository with a simple implementation of my solution. (The solution itself is not that simple, but the demo ;-) ) It's a custom variation of the original infinite scroll component. Scrolling back and forth with a replacement of the content to prevent DOM stuffing. As well the fetched content will scroll to the correct position after loading. The original loading spinner is replaced by a Loading component, because having the spinner on top of the list won't work that easy. |
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. |
Trying to build contact list with about 10k nodes, my assumption was to combine virtualScroll and infinite-scroll controller, so my page is like below:
and .ts controller
so after every doInfiniteInvitation call it resets to the top position, is it possible somehow avoid this "feature"?
may be [virtualTrackBy]="virtualTrack" can help with that?
The text was updated successfully, but these errors were encountered: