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 {
104
104
}
105
105
106
106
// 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
+ }
113
115
}
114
116
}
115
117
@@ -303,6 +305,6 @@ export default class Virtual {
303
305
304
306
// get the item estimate size
305
307
getEstimateSize ( ) {
306
- return this . firstRangeAverageSize || this . param . estimateSize
308
+ return this . isFixedType ( ) ? this . fixedSizeValue : ( this . firstRangeAverageSize || this . param . estimateSize )
307
309
}
308
310
}
You can’t perform that action at this time.
0 commit comments