Skip to content

Commit

Permalink
Fixing the viewport height math - fixes scrollbar
Browse files Browse the repository at this point in the history
The calculation for newViewportHeight is off by 1px in webkit-based browsers. In cases where the actual grid height is less than the grid's max-height (even if a max-height hasn't been set) vertical-overflow scrollbars are appended to the DOM. Increasing the newViewPort by 1px corrects this issue.
  • Loading branch information
davidsanders authored and c0bra committed Apr 22, 2014
1 parent 7bde5f6 commit 37281bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/ng-grid-flexible-height.js
Expand Up @@ -18,7 +18,7 @@ function ngGridFlexibleHeightPlugin (opts) {
}
}

var newViewportHeight = naturalHeight + 2;
var newViewportHeight = naturalHeight + 3;
if (!self.scope.baseViewportHeight || self.scope.baseViewportHeight !== newViewportHeight) {
self.grid.$viewport.css('height', newViewportHeight + 'px');
self.grid.$root.css('height', (newViewportHeight + extraHeight) + 'px');
Expand Down

0 comments on commit 37281bc

Please sign in to comment.