File tree 1 file changed +2
-10
lines changed
core/src/components/virtual-scroll
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,6 @@ export class VirtualScroll {
125
125
}
126
126
contentEl . componentOnReady ( ) . then ( ( ) => {
127
127
this . scrollEl = contentEl . getScrollElement ( ) ;
128
- this . calcDimensions ( ) ;
129
128
this . calcCells ( ) ;
130
129
this . updateState ( ) ;
131
130
} ) ;
@@ -147,7 +146,6 @@ export class VirtualScroll {
147
146
@Listen ( 'window:resize' )
148
147
onResize ( ) {
149
148
this . indexDirty = 0 ;
150
- this . calcDimensions ( ) ;
151
149
this . calcCells ( ) ;
152
150
this . updateVirtualScroll ( ) ;
153
151
}
@@ -232,6 +230,7 @@ export class VirtualScroll {
232
230
}
233
231
this . viewportOffset = topOffset ;
234
232
if ( scrollEl ) {
233
+ this . viewportHeight = scrollEl . offsetHeight ;
235
234
this . currentScrollTop = scrollEl . scrollTop ;
236
235
}
237
236
}
@@ -313,8 +312,7 @@ export class VirtualScroll {
313
312
private updateState ( ) {
314
313
const shouldEnable = ! ! (
315
314
this . scrollEl &&
316
- this . cells &&
317
- this . viewportHeight > 1
315
+ this . cells
318
316
) ;
319
317
if ( shouldEnable !== this . isEnabled ) {
320
318
this . enableScrollEvents ( shouldEnable ) ;
@@ -360,12 +358,6 @@ export class VirtualScroll {
360
358
this . indexDirty = Infinity ;
361
359
}
362
360
363
- private calcDimensions ( ) {
364
- if ( this . scrollEl ) {
365
- this . viewportHeight = this . scrollEl . offsetHeight ;
366
- }
367
- }
368
-
369
361
private enableScrollEvents ( shouldListen : boolean ) {
370
362
if ( this . scrollEl ) {
371
363
this . isEnabled = shouldListen ;
You can’t perform that action at this time.
0 commit comments