Unmount child views correctly

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-07-14 17:30:59 +05:30
parent 2502c4024a
commit c073d4c0d0

View file

@ -130,15 +130,18 @@ export class LazyListView extends ListView {
}
return array;
}
_renderElementsInRange() {
const { topCount, renderCount, bottomCount } = this._renderRange;
const paddingTop = topCount * this._itemHeight;
const paddingBottom = bottomCount * this._itemHeight;
const renderedItems = this._itemsFromList(topCount, topCount + renderCount);
console.log(renderedItems);
this._root.style.paddingTop = `${paddingTop}px`;
this._root.style.paddingBottom = `${paddingBottom}px`;
this._root.innerHTML = "";
for (const child of this._childInstances) {
child.root().remove();
child.unmount();
}
this._renderItems(renderedItems);
}