@ -172,8 +172,9 @@ export default class ScrollableList extends PureComponent {
const someItemInserted = React . Children . count ( prevProps . children ) > 0 &&
const someItemInserted = React . Children . count ( prevProps . children ) > 0 &&
React . Children . count ( prevProps . children ) < React . Children . count ( this . props . children ) &&
React . Children . count ( prevProps . children ) < React . Children . count ( this . props . children ) &&
this . getFirstChildKey ( prevProps ) !== this . getFirstChildKey ( this . props ) ;
this . getFirstChildKey ( prevProps ) !== this . getFirstChildKey ( this . props ) ;
const pendingChanged = ( prevProps . numPending > 0 ) !== ( this . props . numPending > 0 ) ;
if ( someItemInserted && ( this . getScrollTop ( ) > 0 || this . mouseMovedRecently ) ) {
if ( pendingChanged || someItemInserted && ( this . getScrollTop ( ) > 0 || this . mouseMovedRecently ) ) {
return this . getScrollHeight ( ) - this . getScrollTop ( ) ;
return this . getScrollHeight ( ) - this . getScrollTop ( ) ;
} else {
} else {
return null ;
return null ;
@ -261,6 +262,13 @@ export default class ScrollableList extends PureComponent {
handleLoadPending = e => {
handleLoadPending = e => {
e . preventDefault ( ) ;
e . preventDefault ( ) ;
this . props . onLoadPending ( ) ;
this . props . onLoadPending ( ) ;
// Prevent the weird scroll-jumping behavior, as we explicitly don't want to
// scroll to top, and we know the scroll height is going to change
this . scrollToTopOnMouseIdle = false ;
this . lastScrollWasSynthetic = false ;
this . clearMouseIdleTimer ( ) ;
this . mouseIdleTimer = setTimeout ( this . handleMouseIdle , MOUSE _IDLE _DELAY ) ;
this . mouseMovedRecently = true ;
}
}
render ( ) {
render ( ) {