From cdbcc51927002eb88a31a0842b4f7bce6c3c7cdf Mon Sep 17 00:00:00 2001 From: inportb Date: Thu, 25 May 2023 06:20:23 -0400 Subject: [PATCH] More selective scroll detection --- htdocs/RoutePatientReports.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/RoutePatientReports.vue b/htdocs/RoutePatientReports.vue index 620d1af..f23ad50 100644 --- a/htdocs/RoutePatientReports.vue +++ b/htdocs/RoutePatientReports.vue @@ -532,9 +532,9 @@ ); }, mounted() { - this.observer_scroller = new IntersectionObserver(() => { if((this.date_next) && (!this.query.replace(/^\s+|\s+$/g, '')) && (this.selection)) this.date_begin = this.date_next; }, { root: this.$refs.scroller, rootMargin: '25%' }); + this.observer_scroller = new IntersectionObserver(([entry]) => { if((entry.isIntersecting) && (this.selection) && (this.date_next) && (!this.is_loading) && (!this.query.replace(/^\s+|\s+$/g, ''))) this.date_begin = this.date_next; }, { root: this.$refs.scroller, rootMargin: '25%' }); this.observer_scroller.observe(this.$refs.bottom); - this.observer_viewport = new IntersectionObserver(() => { if((this.date_next) && (!this.query.replace(/^\s+|\s+$/g, '')) && (!this.selection)) this.date_begin = this.date_next; }, { rootMargin: '25%' }); + this.observer_viewport = new IntersectionObserver(([entry]) => { if((entry.isIntersecting) && (!this.selection) && (this.date_next) && (!this.is_loading) && (!this.query.replace(/^\s+|\s+$/g, ''))) this.date_begin = this.date_next; }, { rootMargin: '25%' }); this.observer_viewport.observe(this.$refs.bottom); }, destroyed() {