Skip to content

Commit d3e1911

Browse files
committed
fix(Grid): Add border to rendered height calc.
1 parent 9c27468 commit d3e1911

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7223,20 +7223,24 @@ export abstract class IgxGridBaseDirective implements GridType,
72237223
if (!this._height) {
72247224
return null;
72257225
}
7226+
const styles = this.document.defaultView.getComputedStyle(this.nativeElement);
72267227
const actualTheadRow = this.getTheadRowHeight();
72277228
const footerHeight = this.getFooterHeight();
72287229
const toolbarHeight = this.getToolbarHeight();
72297230
const pagingHeight = this.getPagingFooterHeight();
72307231
const groupAreaHeight = this.getGroupAreaHeight();
72317232
const scrHeight = this.getComputedHeight(this.scr.nativeElement);
7233+
const borderTop = parseFloat(styles.getPropertyValue('border-top'));
7234+
const borderBottom = parseFloat(styles.getPropertyValue('border-bottom'));
7235+
72327236
const renderedHeight = toolbarHeight + actualTheadRow +
72337237
footerHeight + pagingHeight + groupAreaHeight +
7234-
scrHeight;
7238+
scrHeight + borderTop + borderBottom;
72357239

72367240
let gridHeight = 0;
72377241

72387242
if (this.isPercentHeight) {
7239-
const computed = this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('height');
7243+
const computed = styles.getPropertyValue('height');
72407244
const autoSize = this._shouldAutoSize(renderedHeight);
72417245
if (autoSize || computed.indexOf('%') !== -1) {
72427246
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)