diff --git a/frontend/src/components/SearchForm.vue b/frontend/src/components/SearchForm.vue index 9745fca..f0dbd50 100644 --- a/frontend/src/components/SearchForm.vue +++ b/frontend/src/components/SearchForm.vue @@ -4,7 +4,7 @@ class="p-6 bg-white dark:bg-dark-200 shadow-lg rounded-xl absolute bottom-0 border-2 border-black" >
-
+
{ - // TODO: this seems too sensitive - const endOfPage = window.innerHeight + window.pageYOffset >= document.body.offsetHeight; + const container = document.getElementById("trainers--container"); + if (container) { + const { scrollTop, scrollHeight, clientHeight } = container; - if (endOfPage) { - store.loadNextPage(); + if (scrollTop + clientHeight >= scrollHeight - 5) { + store.loadNextPage(); + } } }, 1000); }