fix(knowledge): fill viewport on load when sentinel stays visible

This commit is contained in:
2026-04-03 14:07:52 -04:00
parent 22003788f5
commit 8024706870
+10
View File
@@ -84,6 +84,16 @@ async function fetchItems(reset = false) {
} finally {
loading.value = false;
}
// If the sentinel is still in the viewport after appending, keep loading
if (!reset && items.value.length < total.value) {
await nextTick();
const rect = sentinelEl.value?.getBoundingClientRect();
if (rect && rect.top < window.innerHeight + 200) {
page.value++;
await fetchItems();
}
}
}
async function fetchTags() {