From d55f38a9e92af35f6f91f495f9f225ebdfdc45dc Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 27 Oct 2020 16:26:45 +0100 Subject: [PATCH] don't reimplement removing an item from the list --- src/platform/web/ui/general/ListView.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/platform/web/ui/general/ListView.js b/src/platform/web/ui/general/ListView.js index ccbf0d92..3ec7207c 100644 --- a/src/platform/web/ui/general/ListView.js +++ b/src/platform/web/ui/general/ListView.js @@ -147,15 +147,13 @@ export class ListView { recreateItem(index, value) { if (this._childInstances) { const child = this._childCreator(value); - let oldChild; - if (child) { - oldChild = this._childInstances.splice(index, 1, child)[0]; - this._root.replaceChild(child.mount(this._mountArgs), oldChild.root()); + if (!child) { + this.onRemove(index, value); } else { - oldChild = this._childInstances.splice(index, 1)[0]; - oldChild.root().remove(); + const [oldChild] = this._childInstances.splice(index, 1, child); + this._root.replaceChild(child.mount(this._mountArgs), oldChild.root()); + oldChild.unmount(); } - oldChild.unmount(); } }