Skip to content

Commit 82074e8

Browse files
committed
Merge pull request #2379 from Servoy/row_inserts_before_current_fix
regression fix for: #2357 scrolling with large amount of columns,columns disappear after sort
2 parents 079f358 + b75df2f commit 82074e8

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)