From d6b2166e0d63938fd89ae0f772eaec729401f2c0 Mon Sep 17 00:00:00 2001 From: rorz <1853310+rorz@users.noreply.github.com> Date: Thu, 21 Jan 2021 14:08:44 +0000 Subject: [PATCH] Make hasScrolledToBottom check more lenient in order to catch sub-pixel overshoots --- src/components/Scrollable/Scrollable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Scrollable/Scrollable.tsx b/src/components/Scrollable/Scrollable.tsx index 4a1602c3571..cbdb3b58851 100644 --- a/src/components/Scrollable/Scrollable.tsx +++ b/src/components/Scrollable/Scrollable.tsx @@ -160,7 +160,7 @@ export class Scrollable extends Component { const shouldTopShadow = Boolean(shadow && scrollTop > 0); const canScroll = scrollHeight > clientHeight; - const hasScrolledToBottom = scrollHeight - scrollTop === clientHeight; + const hasScrolledToBottom = scrollHeight - scrollTop <= clientHeight; if (canScroll && hasScrolledToBottom && onScrolledToBottom) { onScrolledToBottom();