Skip to content

Commit

Permalink
RG-1809 more tolerance on scrolledToBottom detection
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-skl committed Jun 6, 2018
1 parent d49d89f commit 7cf12bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/island/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion components/user-agreement/user-agreement.examples.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<example name="User Agreement">
<file type="html"}>
<file type="html" disable-auto-size>
<div id="demo"></div>
</file>

Expand Down
1 change: 1 addition & 0 deletions components/user-agreement/user-agreement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cf12bc

Please sign in to comment.