Ionic 2 beta 11 virtual scroll and infinite scroll autoscrolls up after update
See original GitHub issueTrying to build contact list with about 10k nodes, my assumption was to combine virtualScroll and infinite-scroll controller, so my page is like below:
<ion-content>
<ion-list [virtualScroll]="contacts">
<ion-item *virtualItem="let contact">
....
</ion-item>
</ion-list>
<ion-infinite-scroll (ionInfinite)="doInfiniteInvitation($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
and .ts controller
doInfiniteInvitation(infiniteScroll) {
console.log('doInfiniteInvitation');
this.contactsService.contact_invitations()
.then(contacts => {
for (var i = 0; i < contacts.length; i++) {
this.contacts.push(contacts[i]);
}
infiniteScroll.complete();
console.log('doInfiniteInvitation done');
});
}
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?
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (6 by maintainers)
Top Results From Across the Web
ion-virtual-scroll - Ionic Framework
Virtual Scroll displays a virtual, "infinite" list. An array of records is passed to the virtual scroll containing the data to create templates...
Read more >VirtualScroll + InfiniteScroll scrolls top when reaching list bottom
When the bottom of virtual list is reached, infinite scroll is triggered, items are loaded and displayed all ok, but after that the...
Read more >An example of virtualScroll and Infinite Scroll in Ionic 2
In this post, Andrew describes how you can use the Ionic CLI to generate both an application and a boilerplate HTTP service, or...
Read more >Increase Ionic Scroll Performance with Virtual Scroll & Infinite ...
In this tutorial we increase our list performance with big data using Ionic Virtual Scroll & Infinite Scroll ! Learn to build mobile...
Read more >How to use Angular Virtual Scroll with Ionic - YouTube
The Ionic virtual scroll component was deprecated with Ionic 6, but we can easily transition to the Angular virtual scroll implementation to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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. https://github.com/lujakob/ionic-infinite-scroll-example
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…