Skip to content

Commit 822d8cd

Browse files
committed
fix(Grid): Add border to rendered height calc.
1 parent e169c93 commit 822d8cd

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7259,20 +7259,24 @@ export abstract class IgxGridBaseDirective implements GridType,
72597259
if (!this._height) {
72607260
return null;
72617261
}
7262+
const styles = this.document.defaultView.getComputedStyle(this.nativeElement);
72627263
const actualTheadRow = this.getTheadRowHeight();
72637264
const footerHeight = this.getFooterHeight();
72647265
const toolbarHeight = this.getToolbarHeight();
72657266
const pagingHeight = this.getPagingFooterHeight();
72667267
const groupAreaHeight = this.getGroupAreaHeight();
72677268
const scrHeight = this.getComputedHeight(this.scr.nativeElement);
7269+
const borderTop = parseFloat(styles.getPropertyValue('border-top'));
7270+
const borderBottom = parseFloat(styles.getPropertyValue('border-bottom'));
7271+
72687272
const renderedHeight = toolbarHeight + actualTheadRow +
72697273
footerHeight + pagingHeight + groupAreaHeight +
7270-
scrHeight;
7274+
scrHeight + borderTop + borderBottom;
72717275

72727276
let gridHeight = 0;
72737277

72747278
if (this.isPercentHeight) {
7275-
const computed = this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('height');
7279+
const computed = styles.getPropertyValue('height');
72767280
const autoSize = this._shouldAutoSize(renderedHeight);
72777281
if (autoSize || computed.indexOf('%') !== -1) {
72787282
const bodyHeight = this.getDataBasedBodyHeight();

src/app/grid-auto-size/grid-auto-size.sample.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@
1111
margin-bottom: 16px;
1212
max-width: 900px;
1313
}
14+
15+
16+
igx-grid {
17+
border: 1px solid lightgray;
18+
}

0 commit comments

Comments
 (0)