feat:fix when continious reset list,then getBatchedItems will continious call twice
This commit is contained in:
parent
4ea6da2d0a
commit
e46f09427b
@ -89,12 +89,9 @@ export class List extends Superview implements IList {
|
||||
this.itemCount = 0
|
||||
}
|
||||
private getItem(itemIdx: number) {
|
||||
let view = this.cachedViews.get(`${itemIdx}`)
|
||||
if (view === undefined) {
|
||||
view = this.renderItem(itemIdx)
|
||||
let view = this.renderItem(itemIdx)
|
||||
view.superview = this
|
||||
this.cachedViews.set(`${itemIdx}`, view)
|
||||
}
|
||||
return view
|
||||
}
|
||||
|
||||
@ -108,7 +105,7 @@ export class List extends Superview implements IList {
|
||||
}
|
||||
|
||||
private renderBunchedItems(start: number, length: number) {
|
||||
this.ignoreDirtyCallOnce = true;
|
||||
this.ignoreDirtyCallOnce = true
|
||||
return new Array(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