Fix global search endless scroller for big screens [SCI-10736]

This commit is contained in:
Andrej 2024-05-23 13:12:25 +02:00
parent f94d2b72eb
commit 069a582432

View file

@ -88,11 +88,13 @@ export default {
handleScroll() {
if (this.loading || !this.selected) return;
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 50) {
if (this.results.length < this.total) {
this.loadData();
this.$nextTick(() => {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 50) {
if (this.results.length < this.total) {
this.loadData();
}
}
}
});
},
changeSort(sort) {
this.sort = sort;
@ -136,6 +138,8 @@ export default {
this.disabled = response.data.meta.disabled;
this.loading = false;
this.page = response.data.meta.next_page;
this.handleScroll();
}
})
.finally(() => {