Skip to content

Commit

Permalink
fix: πŸ› don't call needLoadMoreData on last row with cellNav
Browse files Browse the repository at this point in the history
Unable to edit the last row if both cellNav and infiniteScroll were
present (caused infinte refresh loop with scrollDown)
  • Loading branch information
moeyang13 authored and mportuga committed Jul 31, 2023
1 parent 4002bd8 commit 5200747
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/infinite-scroll/src/js/infinite-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,14 @@
grid.infiniteScroll.direction = grid.scrollDirection;
delete grid.infiniteScroll.prevScrollTop;

if (grid.scrollDirection === uiGridConstants.scrollDirection.UP && grid.infiniteScroll.scrollUp ) {
if (grid.scrollDirection === uiGridConstants.scrollDirection.UP && grid.infiniteScroll.scrollUp) {
grid.infiniteScroll.dataLoading = true;
grid.api.infiniteScroll.raise.needLoadMoreDataTop();
}
else if (grid.scrollDirection === uiGridConstants.scrollDirection.DOWN && grid.infiniteScroll.scrollDown ) {
else if (grid.scrollDirection === uiGridConstants.scrollDirection.DOWN && grid.infiniteScroll.scrollDown) {
if (grid.cellNav && grid.cellNav.lastRowCol && grid.cellNav.lastRowCol.row.index === grid.infiniteScroll.previousVisibleRows - 1) {
return;
}
grid.infiniteScroll.dataLoading = true;
grid.api.infiniteScroll.raise.needLoadMoreData();
}
Expand Down

0 comments on commit 5200747

Please sign in to comment.