Skip to content

Commit 29c0a36

Browse files
authored
Merge pull request #5740 from Ladekarl/fix-rendered-columns-zero-if-vertical-scrollbar-is-very-small
vertical scroll length should never be 0. This will result in division by 0 errors.
2 parents 4543e9c + fd70a00 commit 29c0a36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/core/factories/GridRenderContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ angular.module('ui.grid')
300300
};
301301

302302
GridRenderContainer.prototype.getVerticalScrollLength = function getVerticalScrollLength() {
303-
return this.getCanvasHeight() - this.getViewportHeight() + this.grid.scrollbarHeight;
303+
return this.getCanvasHeight() - this.getViewportHeight() + this.grid.scrollbarHeight !== 0 ? this.getCanvasHeight() - this.getViewportHeight() + this.grid.scrollbarHeight : -1;
304304
};
305305

306306
GridRenderContainer.prototype.getHorizontalScrollLength = function getHorizontalScrollLength() {
307-
return this.getCanvasWidth() - this.getViewportWidth() + this.grid.scrollbarWidth;
307+
return this.getCanvasWidth() - this.getViewportWidth() + this.grid.scrollbarWidth !== 0 ? this.getCanvasWidth() - this.getViewportWidth() + this.grid.scrollbarWidth : -1;
308308
};
309309

310310
GridRenderContainer.prototype.getCanvasWidth = function getCanvasWidth() {

0 commit comments

Comments
 (0)