js:fix list renderBunchedItems array size <0

This commit is contained in:
pengfei.zhou
2020-03-31 11:59:33 +08:00
committed by osborn
parent a2653711f8
commit 5d3016f46a
6 changed files with 6 additions and 6 deletions

View File

@@ -67,7 +67,7 @@ export class List extends Superview {
}
renderBunchedItems(start, length) {
this.ignoreDirtyCallOnce = true;
return new Array(Math.min(length, this.itemCount - start)).fill(0).map((_, idx) => {
return new Array(Math.max(0, Math.min(length, this.itemCount - start))).fill(0).map((_, idx) => {
const listItem = this.getItem(start + idx);
return listItem.toModel();
});