trigger pagination if table body is delayed populated
All checks were successful
delpoy / build-and-deploy (push) Successful in 43s

This commit is contained in:
bytedream 2024-11-29 12:54:54 +01:00
parent c89cbdd389
commit aacd618d4f
2 changed files with 8 additions and 12 deletions

View File

@ -43,9 +43,15 @@
); );
new MutationObserver(async (entries) => { new MutationObserver(async (entries) => {
if (entries.filter((e) => e.removedNodes.length > 0).length === 0 || !entries) return; if (!entries) {
return;
} else if (
entries.findIndex((e) => e.addedNodes.length > 0 || e.removedNodes.length > 0) == -1
) {
return;
}
intersectionObserver.unobserve(intersectionElement); if (intersectionElement) intersectionObserver.unobserve(intersectionElement);
intersectionObserver.observe((intersectionElement = await getIntersectionElement())); intersectionObserver.observe((intersectionElement = await getIntersectionElement()));
}).observe(bodyElem, { childList: true }); }).observe(bodyElem, { childList: true });

View File

@ -183,16 +183,6 @@
</td> </td>
</tr> </tr>
{/each} {/each}
<tr>
<td colspan="100">
<div class="flex justify-center items-center">
<button class="btn btn-sm" on:click={() => newUserModal.show()}>
<Plus />
<span>Neuer Spieler</span>
</button>
</div>
</td>
</tr>
</PaginationTableBody> </PaginationTableBody>
</table> </table>
</div> </div>