Skip to content

Commit 1c85921

Browse files
author
ardentia
committed
fix detection calcuations
1 parent 8afdfa5 commit 1c85921

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

projects/ng-sq-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sq-ui/ng-sq-common",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"license": "MIT",
55
"private": false,
66
"description": "The core module for SQ-UI kit for Angular",

projects/ng-sq-common/src/lib/directives/scrolled-to-bottom-listener.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export class ScrolledToBottomListenerDirective implements OnDestroy {
1717
}
1818

1919
checkIfHasScrolledToBottom(element: HTMLElement) {
20-
const hasScrolledToBottom = element.scrollTop > 0 ? ((element.scrollHeight - element.scrollTop) === element.clientHeight) : false;
20+
const hasScrolledToBottom = element.scrollTop > 0 ?
21+
(Math.ceil(element.scrollHeight - element.scrollTop) <= element.clientHeight) : false;
2122

2223
if (hasScrolledToBottom) {
2324
this.scrolledToBottom.emit();

0 commit comments

Comments
 (0)