Skip to content

Commit

Permalink
fix(autoResize): fix the computation of width/height to enable scroll
Browse files Browse the repository at this point in the history
This fix is only relevant for IE 11 and older versions, where gridUtil.outerElementHeight or outerElementWidth does not return correct values if ui-grid has padding or borders. This leads to the problem of not allowing the page to scroll, if the mouse is on the list, even if there is nothing to scroll down in ui-grid.

This solution uses jQuery and it cannot be submitted as a pull request according to the guidelines of ui-grid.

Alternatively, one needs to expand the methods in gridUtil to the case of IE11 and older.
  • Loading branch information
classix-od committed Nov 9, 2017
1 parent e684621 commit 6285e3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/features/auto-resize-grid/js/auto-resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
var prevGridWidth, prevGridHeight;

function getDimensions() {
prevGridHeight = gridUtil.elementHeight($elm);
prevGridWidth = gridUtil.elementWidth($elm);
prevGridHeight = $elm.outerHeight();
prevGridWidth = $elm.outerWidth();
}

// Initialize the dimensions
Expand All @@ -35,8 +35,8 @@
clearTimeout(resizeTimeoutId);

resizeTimeoutId = setTimeout(function () {
var newGridHeight = gridUtil.elementHeight($elm);
var newGridWidth = gridUtil.elementWidth($elm);
var newGridHeight = $elm.outerHeight();
var newGridWidth = $elm.outerWidth();

if (newGridHeight !== prevGridHeight || newGridWidth !== prevGridWidth) {
uiGridCtrl.grid.gridHeight = newGridHeight;
Expand Down

0 comments on commit 6285e3f

Please sign in to comment.