@ -30,7 +30,6 @@ export default class ScrollableList extends PureComponent {
hasMore : PropTypes . bool ,
hasMore : PropTypes . bool ,
prepend : PropTypes . node ,
prepend : PropTypes . node ,
alwaysPrepend : PropTypes . bool ,
alwaysPrepend : PropTypes . bool ,
alwaysShowScrollbar : PropTypes . bool ,
emptyMessage : PropTypes . node ,
emptyMessage : PropTypes . node ,
children : PropTypes . node ,
children : PropTypes . node ,
} ;
} ;
@ -206,11 +205,11 @@ export default class ScrollableList extends PureComponent {
}
}
render ( ) {
render ( ) {
const { children , scrollKey , trackScroll , shouldUpdateScroll , showLoading , isLoading , hasMore , prepend , alwaysPrepend , alwaysShowScrollbar, emptyMessage, onLoadMore } = this . props ;
const { children , scrollKey , trackScroll , shouldUpdateScroll , showLoading , isLoading , hasMore , prepend , alwaysPrepend , emptyMessage, onLoadMore } = this . props ;
const { fullscreen } = this . state ;
const { fullscreen } = this . state ;
const childrenCount = React . Children . count ( children ) ;
const childrenCount = React . Children . count ( children ) ;
const loadMore = ( hasMore && childrenCount > 0 && onLoadMore) ? < LoadMore visible = { ! isLoading } onClick = { this . handleLoadMore } / > : null ;
const loadMore = ( hasMore && onLoadMore) ? < LoadMore visible = { ! isLoading } onClick = { this . handleLoadMore } / > : null ;
let scrollableArea = null ;
let scrollableArea = null ;
if ( showLoading ) {
if ( showLoading ) {
@ -225,7 +224,7 @@ export default class ScrollableList extends PureComponent {
< / d i v >
< / d i v >
< / d i v >
< / d i v >
) ;
) ;
} else if ( isLoading || childrenCount > 0 || ! emptyMessage ) {
} else if ( isLoading || childrenCount > 0 || hasMore || ! emptyMessage ) {
scrollableArea = (
scrollableArea = (
< div className = { classNames ( 'scrollable' , { fullscreen } ) } ref = { this . setRef } onMouseMove = { this . handleMouseMove } >
< div className = { classNames ( 'scrollable' , { fullscreen } ) } ref = { this . setRef } onMouseMove = { this . handleMouseMove } >
< div role = 'feed' className = 'item-list' >
< div role = 'feed' className = 'item-list' >
@ -249,10 +248,8 @@ export default class ScrollableList extends PureComponent {
< / d i v >
< / d i v >
) ;
) ;
} else {
} else {
const scrollable = alwaysShowScrollbar ;
scrollableArea = (
scrollableArea = (
< div className = { classNames ( { scrollable , fullscreen } ) } ref = { this . setRef } style = { { flex : '1 1 auto' , display : 'flex' , flexDirection : 'column' } } >
< div className = { classNames ( 'scrollable scrollable--flex' , { fullscreen } ) } ref = { this . setRef } >
{ alwaysPrepend && prepend }
{ alwaysPrepend && prepend }
< div className = 'empty-column-indicator' >
< div className = 'empty-column-indicator' >