Added disableInfiniteScroll prop to ScrollableList component
• Added: - disableInfiniteScroll prop to ScrollableList component
This commit is contained in:
parent
6247c32206
commit
b6f8674054
@ -98,7 +98,7 @@ class ScrollableList extends React.PureComponent {
|
|||||||
const { innerHeight } = this.window;
|
const { innerHeight } = this.window;
|
||||||
const offset = scrollHeight - scrollTop - innerHeight;
|
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();
|
this.props.onLoadMore();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,6 +271,7 @@ ScrollableList.propTypes = {
|
|||||||
onScroll: PropTypes.func,
|
onScroll: PropTypes.func,
|
||||||
placeholderComponent: PropTypes.node,
|
placeholderComponent: PropTypes.node,
|
||||||
placeholderCount: PropTypes.node,
|
placeholderCount: PropTypes.node,
|
||||||
|
disableInfiniteScroll: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ScrollableList
|
export default ScrollableList
|
Loading…
x
Reference in New Issue
Block a user