From 7cf12bcc6be6ff9441065f2f3d9839348157a9d6 Mon Sep 17 00:00:00 2001 From: "Andrey.Skladchikov" Date: Wed, 6 Jun 2018 11:56:25 +0300 Subject: [PATCH] RG-1809 more tolerance on scrolledToBottom detection --- components/island/content.js | 3 ++- components/user-agreement/user-agreement.examples.html | 2 +- components/user-agreement/user-agreement.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/island/content.js b/components/island/content.js index e65e92b8119..0f0cc372a3b 100644 --- a/components/island/content.js +++ b/components/island/content.js @@ -51,13 +51,14 @@ export default class Content extends Component { }; calculateScrollPosition = () => scheduleScrollAction(() => { + const END_DISTANCE = 6; const {scrollableNode} = this; if (!scrollableNode) { return; } const {scrollTop, scrollHeight, offsetHeight} = scrollableNode; const scrolledToTop = scrollTop === 0; - const scrolledToBottom = offsetHeight + scrollTop >= scrollHeight; + const scrolledToBottom = offsetHeight + scrollTop >= scrollHeight - END_DISTANCE; if (scrolledToBottom) { this.props.onScrollToBottom(); diff --git a/components/user-agreement/user-agreement.examples.html b/components/user-agreement/user-agreement.examples.html index e3f6db39b10..82726431531 100644 --- a/components/user-agreement/user-agreement.examples.html +++ b/components/user-agreement/user-agreement.examples.html @@ -1,5 +1,5 @@ - +
diff --git a/components/user-agreement/user-agreement.js b/components/user-agreement/user-agreement.js index bb8cd813fce..6038f3a73ec 100644 --- a/components/user-agreement/user-agreement.js +++ b/components/user-agreement/user-agreement.js @@ -2,6 +2,7 @@ * @name User Agreement * @category Components * @framework React + * @tags Ring UI Language * @constructor * @description A component that displays a user agreement dialog. * @example-file ./user-agreement.examples.html