Skip to content

Commit

Permalink
regression fix for: angular-ui#2357 scrolling with large amount of co…
Browse files Browse the repository at this point in the history
…lumns,columns

disappear after sort 

scrollTop can now be undefined/null then that value should not be used
for calculating if this is a scroll that doesn't have to update
anything.
  • Loading branch information
jcompagner committed Dec 17, 2014
1 parent 9dc69f0 commit 608cd77
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/js/core/factories/GridRenderContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,15 @@ angular.module('ui.grid')

var newRange = [];
if (rowCache.length > self.grid.options.virtualizationThreshold) {
// Have we hit the threshold going down?
if (self.prevScrollTop < scrollTop && rowIndex < self.prevRowScrollIndex + self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
return;
}
//Have we hit the threshold going up?
if (self.prevScrollTop > scrollTop && rowIndex > self.prevRowScrollIndex - self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
return;
if (!(typeof(scrollTop) === 'undefined' || scrollTop === null)) {
// Have we hit the threshold going down?
if (self.prevScrollTop < scrollTop && rowIndex < self.prevRowScrollIndex + self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
return;
}
//Have we hit the threshold going up?
if (self.prevScrollTop > scrollTop && rowIndex > self.prevRowScrollIndex - self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
return;
}
}

var rangeStart = Math.max(0, rowIndex - self.grid.options.excessRows);
Expand Down

0 comments on commit 608cd77

Please sign in to comment.