3.0.0 and 2.3.0 VirtualScroll not working

VirtualScroll won’t to render items after timeouts or async http calls (Promises)

Template:

<ion-header>
<ion-navbar>
<ion-title>
Ionic Blank
</ion-title>
</ion-navbar>
</ion-header>

<ion-content padding>
<ion-list [virtualScroll]=“items” >
<ion-item *virtualItem=“let item” >
<h2>{{item}}</h2>
</ion-item>
</ion-list>
</ion-content>

Code:

import { Component, NgZone } from ‘@angular/core’;

import { NavController } from ‘ionic-angular’;

@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {

items: Array = [];
constructor(public navCtrl: NavController, private zone: NgZone) {

}

ionViewDidLoad() {
setTimeout(() => {

    for (let i = 0; i < 10000; i++) {
      this.items.push(i);
    }
}, 1000);

}

}

2 Likes

Running into the same issue. Tried an *ngIf before on the items.length, but didn’t work either.

For now i switched back to 2.2.0

I did the same things ;). Awaiting for fix

1 Like

Ionic version 3.0.1 the same.
I think the bug in viewcontroller. ViewController calls VirtualScroll.prototype.writeUpdate from writeReady observable subscription but this._recordss till undefined and calls processRecords(stopAtHeight, this._records , this._cells, this._hdrFn, this._ftrFn, this._data); with undefined value

Team, please take a look!