diff --git a/src/InfiniteScroll.js b/src/InfiniteScroll.js index 332f7bd..55a3973 100644 --- a/src/InfiniteScroll.js +++ b/src/InfiniteScroll.js @@ -208,7 +208,15 @@ export default class InfiniteScroll extends Component { } else if (this.props.isReverse) { offset = parentNode.scrollTop; } else { - offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight; + let relativeHeight = + el.getBoundingClientRect().top + + parentNode.scrollTop - + parentNode.getBoundingClientRect().top; + offset = + relativeHeight + + el.scrollHeight - + parentNode.scrollTop - + parentNode.clientHeight; } // Here we make sure the element is visible as well as checking the offset