Skip to content

Commit b16228b

Browse files
ckaeslinbrandyscarney
authored andcommitted
fix(virtual-scroll): set this.approxItemHeight before update(true) is called first (#8350)
1 parent eab5726 commit b16228b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/virtual-scroll/virtual-scroll.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,17 +343,18 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
343343

344344
this._init = true;
345345

346+
if (!this.approxItemHeight) {
347+
this.approxItemHeight = '40px';
348+
console.warn('Virtual Scroll: Please provide an "approxItemHeight" input to ensure proper virtual scroll rendering');
349+
}
350+
346351
this.update(true);
347352

348353
this._platform.onResize(() => {
349354
console.debug('VirtualScroll, onResize');
350355
this.update(false);
351356
});
352357

353-
if (!this.approxItemHeight) {
354-
this.approxItemHeight = '40px';
355-
console.warn('Virtual Scroll: Please provide an "approxItemHeight" input to ensure proper virtual scroll rendering');
356-
}
357358
}
358359
}
359360

0 commit comments

Comments
 (0)