mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
append all list items at once for initial render
This commit is contained in:
parent
1c779cf95c
commit
df8d884d91
@ -102,12 +102,14 @@ export class ListView {
|
|||||||
}
|
}
|
||||||
this._subscription = this._list.subscribe(this);
|
this._subscription = this._list.subscribe(this);
|
||||||
this._childInstances = [];
|
this._childInstances = [];
|
||||||
|
const fragment = document.createDocumentFragment();
|
||||||
for (let item of this._list) {
|
for (let item of this._list) {
|
||||||
const child = this._childCreator(item);
|
const child = this._childCreator(item);
|
||||||
this._childInstances.push(child);
|
this._childInstances.push(child);
|
||||||
const childDomNode = child.mount(this._mountArgs);
|
const childDomNode = child.mount(this._mountArgs);
|
||||||
this._root.appendChild(childDomNode);
|
fragment.appendChild(childDomNode);
|
||||||
}
|
}
|
||||||
|
this._root.appendChild(fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAdd(idx, value) {
|
onAdd(idx, value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user