mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
don't reimplement removing an item from the list
This commit is contained in:
parent
97c3a4b8f3
commit
d55f38a9e9
@ -147,17 +147,15 @@ export class ListView {
|
|||||||
recreateItem(index, value) {
|
recreateItem(index, value) {
|
||||||
if (this._childInstances) {
|
if (this._childInstances) {
|
||||||
const child = this._childCreator(value);
|
const child = this._childCreator(value);
|
||||||
let oldChild;
|
if (!child) {
|
||||||
if (child) {
|
this.onRemove(index, value);
|
||||||
oldChild = this._childInstances.splice(index, 1, child)[0];
|
|
||||||
this._root.replaceChild(child.mount(this._mountArgs), oldChild.root());
|
|
||||||
} else {
|
} else {
|
||||||
oldChild = this._childInstances.splice(index, 1)[0];
|
const [oldChild] = this._childInstances.splice(index, 1, child);
|
||||||
oldChild.root().remove();
|
this._root.replaceChild(child.mount(this._mountArgs), oldChild.root());
|
||||||
}
|
|
||||||
oldChild.unmount();
|
oldChild.unmount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeListChanged() {}
|
onBeforeListChanged() {}
|
||||||
onListChanged() {}
|
onListChanged() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user