File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -143,12 +143,19 @@ export default class InfiniteScroll extends Component<Props, State> {
143143 // do nothing when dataLength is unchanged
144144 if ( this . props . dataLength === prevProps . dataLength ) return ;
145145
146- this . actionTriggered = false ;
146+ const fetchAgain = ( this . _infScroll && this . _scrollableNode ) && this . _scrollableNode . clientHeight > this . _infScroll . scrollHeight
147+ if ( fetchAgain ) {
148+ this . actionTriggered = true ;
149+ this . setState ( { showLoader : true } )
150+ this . props . next ( )
151+ } else {
152+ this . actionTriggered = false ;
153+ // update state when new data was sent in
154+ this . setState ( {
155+ showLoader : false ,
156+ } ) ;
157+ }
147158
148- // update state when new data was sent in
149- this . setState ( {
150- showLoader : false ,
151- } ) ;
152159 }
153160
154161 static getDerivedStateFromProps ( nextProps : Props , prevState : State ) {
You can’t perform that action at this time.
0 commit comments