Skip to content

Commit 608cd77

Browse files
committed
regression fix for: angular-ui#2357 scrolling with large amount of columns,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.
1 parent 9dc69f0 commit 608cd77

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/js/core/factories/GridRenderContainer.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,15 @@ angular.module('ui.grid')
335335

336336
var newRange = [];
337337
if (rowCache.length > self.grid.options.virtualizationThreshold) {
338-
// Have we hit the threshold going down?
339-
if (self.prevScrollTop < scrollTop && rowIndex < self.prevRowScrollIndex + self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
340-
return;
341-
}
342-
//Have we hit the threshold going up?
343-
if (self.prevScrollTop > scrollTop && rowIndex > self.prevRowScrollIndex - self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
344-
return;
338+
if (!(typeof(scrollTop) === 'undefined' || scrollTop === null)) {
339+
// Have we hit the threshold going down?
340+
if (self.prevScrollTop < scrollTop && rowIndex < self.prevRowScrollIndex + self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
341+
return;
342+
}
343+
//Have we hit the threshold going up?
344+
if (self.prevScrollTop > scrollTop && rowIndex > self.prevRowScrollIndex - self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
345+
return;
346+
}
345347
}
346348

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

0 commit comments

Comments
 (0)