From 0a861bf60d47504a0c8cba019671da05dcdb3a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 29 Nov 2021 23:30:33 +0200 Subject: [PATCH] Scroll btn improvement --- src/lib/listing/scroll-button/scroll-button.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/listing/scroll-button/scroll-button.component.ts b/src/lib/listing/scroll-button/scroll-button.component.ts index 22a3b05..e13f7c4 100644 --- a/src/lib/listing/scroll-button/scroll-button.component.ts +++ b/src/lib/listing/scroll-button/scroll-button.component.ts @@ -29,7 +29,7 @@ export class ScrollButtonComponent implements OnInit { ngOnInit(): void { const scrollSize = () => this.scrollViewport.getDataLength() * this.itemSize; const scrollIsNeeded = () => this.scrollViewport.getViewportSize() < scrollSize(); - const reachedEnd = (type: ButtonType) => this.scrollViewport.measureScrollOffset(type) === 0; + const reachedEnd = (type: ButtonType) => this.scrollViewport.measureScrollOffset(type) < 0.5; const showScrollUp = () => scrollIsNeeded() && !reachedEnd(ButtonTypes.top); const showScrollDown = () => scrollIsNeeded() && !reachedEnd(ButtonTypes.bottom);