Skip to content

Commit 99bb972

Browse files
Alexander-TaranAlexander Taran
authored andcommitted
fix(repeat): sometimes getMore is not called
1 parent a0a9fb2 commit 99bb972

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/virtual-repeat.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,10 @@ export class VirtualRepeat extends AbstractRepeater implements IVirtualRepeater
724724
// check if infinite scrollnext should be invoked
725725
// the following block cannot be nested inside didMoveViews condition
726726
// since there could be jumpy scrolling behavior causing infinite scrollnext
727+
const all_items_in_range = this.items.length <= this.minViewsRequired * 2;
728+
const state_to_check = all_items_in_range ? ScrollingState.isNearBottom : (ScrollingState.isNearBottom | ScrollingState.isScrollingDown);
727729
if (
728-
(scrolling_state & (ScrollingState.isScrollingDown | ScrollingState.isNearBottom)) === (ScrollingState.isScrollingDown | ScrollingState.isNearBottom)
730+
(scrolling_state & state_to_check) === state_to_check
729731
|| (scrolling_state & (ScrollingState.isScrollingUp | ScrollingState.isNearTop)) === (ScrollingState.isScrollingUp | ScrollingState.isNearTop)
730732
) {
731733
this.getMore(

0 commit comments

Comments
 (0)