From e68f94920ee71a35e99f72716dfbb8a3d9ba444b Mon Sep 17 00:00:00 2001 From: ardentia Date: Wed, 13 Sep 2023 15:58:30 +0300 Subject: [PATCH] fix detection calcuations --- projects/ng-sq-common/package.json | 2 +- .../src/lib/directives/scrolled-to-bottom-listener.directive.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/ng-sq-common/package.json b/projects/ng-sq-common/package.json index 74e79ff74..cf9b5c831 100644 --- a/projects/ng-sq-common/package.json +++ b/projects/ng-sq-common/package.json @@ -1,6 +1,6 @@ { "name": "@sq-ui/ng-sq-common", - "version": "2.0.1", + "version": "2.0.2", "license": "MIT", "private": false, "description": "The core module for SQ-UI kit for Angular", diff --git a/projects/ng-sq-common/src/lib/directives/scrolled-to-bottom-listener.directive.ts b/projects/ng-sq-common/src/lib/directives/scrolled-to-bottom-listener.directive.ts index 336c0ce4a..a12be2c77 100644 --- a/projects/ng-sq-common/src/lib/directives/scrolled-to-bottom-listener.directive.ts +++ b/projects/ng-sq-common/src/lib/directives/scrolled-to-bottom-listener.directive.ts @@ -17,7 +17,7 @@ export class ScrolledToBottomListenerDirective implements OnDestroy { } checkIfHasScrolledToBottom(element: HTMLElement) { - const hasScrolledToBottom = element.scrollTop > 0 ? ((element.scrollHeight - element.scrollTop) === element.clientHeight) : false; + const hasScrolledToBottom = element.scrollTop > 0 ? (Math.ceil(element.scrollHeight - element.scrollTop) <= element.clientHeight) : false; if (hasScrolledToBottom) { this.scrolledToBottom.emit();