mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 21:15:24 +08:00
fix(virtual-scroll): set this.approxItemHeight before update(true) is called first (#8350)
This commit is contained in:

committed by
Brandy Carney

parent
eab5726fb3
commit
b16228b372
@ -343,6 +343,11 @@ 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(() => {
|
||||
@ -350,10 +355,6 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
|
||||
this.update(false);
|
||||
});
|
||||
|
||||
if (!this.approxItemHeight) {
|
||||
this.approxItemHeight = '40px';
|
||||
console.warn('Virtual Scroll: Please provide an "approxItemHeight" input to ensure proper virtual scroll rendering');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user