We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54d7b16 commit 3d73903Copy full SHA for 3d73903
src/InfiniteScroll.js
@@ -204,7 +204,15 @@ export default class InfiniteScroll extends Component {
204
} else if (this.props.isReverse) {
205
offset = parentNode.scrollTop;
206
} else {
207
- offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;
+ let relativeHeight =
208
+ el.getBoundingClientRect().top +
209
+ parentNode.scrollTop -
210
+ parentNode.getBoundingClientRect().top;
211
+ offset =
212
+ relativeHeight +
213
+ el.scrollHeight -
214
215
+ parentNode.clientHeight;
216
}
217
218
// Here we make sure the element is visible as well as checking the offset
0 commit comments