diff --git a/src/platform/web/ui/general/LazyListView.js b/src/platform/web/ui/general/LazyListView.js index 6864172c..c064a2b5 100644 --- a/src/platform/web/ui/general/LazyListView.js +++ b/src/platform/web/ui/general/LazyListView.js @@ -162,6 +162,7 @@ export class LazyListView extends ListView { onAdd(idx, value) { const {topCount, renderCount, bottomCount} = this._renderRange; if (this._renderRange.containsIndex(idx)) { + this.onBeforeListChanged(); const normalizedIdx = this._renderRange.normalize(idx); if (bottomCount === 0) { /* @@ -179,7 +180,8 @@ export class LazyListView extends ListView { this._removeChild(this._childInstances.pop()); this._renderRange = new ItemRange(topCount, renderCount, bottomCount + 1); } - super.onAdd(normalizedIdx, value); + super.onAdd(normalizedIdx, value, true); + this.onListChanged(); } else { this._renderRange = idx < topCount ? new ItemRange(topCount + 1, renderCount, bottomCount): @@ -191,8 +193,9 @@ export class LazyListView extends ListView { onRemove(idx, value) { const {topCount, renderCount, bottomCount} = this._renderRange; if (this._renderRange.containsIndex(idx)) { + this.onBeforeListChanged(); const normalizedIdx = this._renderRange.normalize(idx); - super.onRemove(normalizedIdx, value); + super.onRemove(normalizedIdx, value, true); if (bottomCount === 0) { // See onAdd for explanation this._renderRange = new ItemRange(topCount, renderCount - 1, bottomCount); @@ -203,6 +206,7 @@ export class LazyListView extends ListView { this._root.appendChild(mountView(child, this._mountArgs)); this._renderRange = new ItemRange(topCount, renderCount, bottomCount - 1); } + this.onListChanged(); } else { this._renderRange = idx < topCount ? new ItemRange(topCount - 1, renderCount, bottomCount):