Virtual scroll vs ion-infinite scroll

What would be the difference conceptually?


1 Like

Virtual Scroll is when you have a long list of items you want to display Ionic only inserts as many as needed to fill the view (plus a few I believe) then adds more into the DOM when the user begins to scroll through the list while also removing those that leave the viewport. This is done to improve performance when dealing with long lists.

Example: you select 100 records to be displayed in a list, Ionic will only insert a percentage of them into the DOM at a time which makes scrolling more fluid.

Infinite scroll is for when you fetch a set number of records and insert them into a list, once you reach teh bottom it’ll fetch the next batch and insert them into the list and repeat that as long as you have items to fetch.


Amazing explanation!