Skip to content

Commit

Permalink
fix(virtual-scroll): set this.approxItemHeight before update(true) is…
Browse files Browse the repository at this point in the history
… called first (#8350)
  • Loading branch information
ckaeslin authored and brandyscarney committed Oct 13, 2016
1 parent eab5726 commit b16228b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/virtual-scroll/virtual-scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,18 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {

this._init = true;

if (!this.approxItemHeight) {
this.approxItemHeight = '40px';
console.warn('Virtual Scroll: Please provide an "approxItemHeight" input to ensure proper virtual scroll rendering');
}

this.update(true);

this._platform.onResize(() => {
console.debug('VirtualScroll, onResize');
this.update(false);
});

if (!this.approxItemHeight) {
this.approxItemHeight = '40px';
console.warn('Virtual Scroll: Please provide an "approxItemHeight" input to ensure proper virtual scroll rendering');
}
}
}

Expand Down

0 comments on commit b16228b

Please sign in to comment.