Delete children at the end of the list, not the beginning

Else the IDs are wrong and need to be updated. This fixes the
bug with it requesting huge offsets when filtering by room name.
This commit is contained in:
Kegan Dougal 2022-02-18 18:39:55 +00:00
parent 44bfebfab9
commit c8f44f6c6b

View File

@ -283,8 +283,8 @@ const render = (container, listIndex) => {
let removeCount = 0;
// ensure we have the right number of children, remove or add appropriately.
while (container.childElementCount > listData.joinedCount) {
intersectionObserver.unobserve(container.firstChild);
container.removeChild(container.firstChild);
intersectionObserver.unobserve(container.lastChild);
container.removeChild(container.lastChild);
removeCount += 1;
}
for (let i = container.childElementCount; i < listData.joinedCount; i++) {