File tree 1 file changed +12
-5
lines changed
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> {
143
143
// do nothing when dataLength is unchanged
144
144
if ( this . props . dataLength === prevProps . dataLength ) return ;
145
145
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
+ }
147
158
148
- // update state when new data was sent in
149
- this . setState ( {
150
- showLoader : false ,
151
- } ) ;
152
159
}
153
160
154
161
static getDerivedStateFromProps ( nextProps : Props , prevState : State ) {
You can’t perform that action at this time.
0 commit comments