js:fix list renderBunchedItems array size <0
This commit is contained in:
parent
a2653711f8
commit
5d3016f46a
@ -1839,7 +1839,7 @@ var List = /** @class */ (function (_super) {
|
||||
List.prototype.renderBunchedItems = function (start, length) {
|
||||
var _this = this;
|
||||
this.ignoreDirtyCallOnce = true;
|
||||
return new Array(Math.min(length, this.itemCount - start)).fill(0).map(function (_, idx) {
|
||||
return new Array(Math.max(0, Math.min(length, this.itemCount - start))).fill(0).map(function (_, idx) {
|
||||
var listItem = _this.getItem(start + idx);
|
||||
return listItem.toModel();
|
||||
});
|
||||
|
@ -1360,7 +1360,7 @@ 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();
|
||||
});
|
||||
|
@ -2819,7 +2819,7 @@ 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();
|
||||
});
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -106,7 +106,7 @@ export class List extends Superview implements IList {
|
||||
|
||||
private renderBunchedItems(start: number, length: number) {
|
||||
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()
|
||||
})
|
||||
|
2
doric-web/dist/index.js
vendored
2
doric-web/dist/index.js
vendored
@ -2877,7 +2877,7 @@ 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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user