Skip to content

Commit 16a283e

Browse files
committed
fix(virtualScroll): load async data
Closes #6124
1 parent e21c4d5 commit 16a283e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

ionic/components/virtual-scroll/test/basic/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ class E2EPage {
1111
@ViewChild('content') content: ElementRef;
1212

1313
constructor() {
14-
for (var i = 0; i < 14; i++) {
14+
for (var i = 0; i < 200; i++) {
1515
this.items.push(i);
1616
}
17-
1817
}
1918

2019
headerFn(record: any, index: number, records: any[]) {

ionic/components/virtual-scroll/virtual-scroll.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
334334
throw 'virtualItem required within virtualScroll';
335335
}
336336

337+
this._init = true;
338+
337339
this.update(true);
338340

339341
this._platform.onResize(() => {
@@ -398,9 +400,6 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
398400

399401
// ******** DOM READ ****************
400402
readDimensions(function() {
401-
// we were able to read good DOM dimension data, let's do this!
402-
self._init = true;
403-
404403
processRecords(self._data.renderHeight,
405404
self._records,
406405
self._cells,

0 commit comments

Comments
 (0)