Skip to content

Commit

Permalink
fix(Grid.js): ScrollIfNecessary determines top boundary wrong
Browse files Browse the repository at this point in the history
Adding headerHeight to topBoundary calculation makes it always larger than pixelsToSeeRow causing an infinite loop.

fixes angular-ui#6653
  • Loading branch information
macomage committed Apr 11, 2018
1 parent 464a1db commit 4e2085b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/core/factories/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2392,7 +2392,8 @@ angular.module('ui.grid')
/*-- Get the top, left, right, and bottom "scrolled" edges of the grid --*/

// The top boundary is the current Y scroll position PLUS the header height, because the header can obscure rows when the grid is scrolled downwards
var topBound = self.renderContainers.body.prevScrollTop + self.headerHeight;
// var topBound = self.renderContainers.body.prevScrollTop + self.headerHeight;
var topBound = self.renderContainers.body.prevScrollTop;

// Don't the let top boundary be less than 0
topBound = (topBound < 0) ? 0 : topBound;
Expand Down

0 comments on commit 4e2085b

Please sign in to comment.