File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,14 @@ export default class Virtual {
104104 }
105105
106106 // calculate the average size only in the first range
107- if ( this . sizes . size <= this . param . keeps ) {
108- this . firstRangeTotalSize = this . firstRangeTotalSize + size
109- this . firstRangeAverageSize = Math . round ( this . firstRangeTotalSize / this . sizes . size )
110- } else {
111- // it's done using
112- delete this . firstRangeTotalSize
107+ if ( this . calcType !== CALC_TYPE . FIXED && typeof this . firstRangeTotalSize !== 'undefined' ) {
108+ if ( this . sizes . size < Math . min ( this . param . keeps , this . param . uniqueIds . length ) ) {
109+ this . firstRangeTotalSize = this . firstRangeTotalSize + size
110+ this . firstRangeAverageSize = Math . round ( this . firstRangeTotalSize / this . sizes . size )
111+ } else {
112+ // it's done using
113+ delete this . firstRangeTotalSize
114+ }
113115 }
114116 }
115117
@@ -303,6 +305,6 @@ export default class Virtual {
303305
304306 // get the item estimate size
305307 getEstimateSize ( ) {
306- return this . firstRangeAverageSize || this . param . estimateSize
308+ return this . isFixedType ( ) ? this . fixedSizeValue : ( this . firstRangeAverageSize || this . param . estimateSize )
307309 }
308310}
You can’t perform that action at this time.
0 commit comments