Added disableInfiniteScroll prop to ScrollableList component

• Added:
- disableInfiniteScroll prop to ScrollableList component
This commit is contained in:
mgabdev 2020-11-09 01:35:07 -06:00
parent 6247c32206
commit b6f8674054
1 changed files with 2 additions and 1 deletions

View File

@ -98,7 +98,7 @@ class ScrollableList extends React.PureComponent {
const { innerHeight } = this.window;
const offset = scrollHeight - scrollTop - innerHeight;
if (600 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) {
if (600 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading && !this.props.disableInfiniteScroll) {
this.props.onLoadMore();
}
@ -271,6 +271,7 @@ ScrollableList.propTypes = {
onScroll: PropTypes.func,
placeholderComponent: PropTypes.node,
placeholderCount: PropTypes.node,
disableInfiniteScroll: PropTypes.bool,
}
export default ScrollableList