Merge pull request #7590 from rekonder/aj_SCI_10736

Fix global search endless scroller for big screens [SCI-10736]
This commit is contained in:
aignatov-bio 2024-05-23 17:50:26 +02:00 committed by GitHub
commit 5d3b69f610
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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(() => {