Skip to content

Commit

Permalink
fix(virtualScroll): load async data
Browse files Browse the repository at this point in the history
Closes #6124
  • Loading branch information
adamdbradley committed Apr 12, 2016
1 parent e21c4d5 commit 16a283e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions ionic/components/virtual-scroll/test/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ class E2EPage {
@ViewChild('content') content: ElementRef;

constructor() {
for (var i = 0; i < 14; i++) {
for (var i = 0; i < 200; i++) {
this.items.push(i);
}

}

headerFn(record: any, index: number, records: any[]) {
Expand Down
5 changes: 2 additions & 3 deletions ionic/components/virtual-scroll/virtual-scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
throw 'virtualItem required within virtualScroll';
}

this._init = true;

this.update(true);

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

// ******** DOM READ ****************
readDimensions(function() {
// we were able to read good DOM dimension data, let's do this!
self._init = true;

processRecords(self._data.renderHeight,
self._records,
self._cells,
Expand Down

0 comments on commit 16a283e

Please sign in to comment.