Skip to content

Commit e658769

Browse files
committed
fix(Grid): Add border to rendered height calc.
1 parent 2b99198 commit e658769

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
@@ -7234,20 +7234,24 @@ export abstract class IgxGridBaseDirective implements GridType,
72347234
if (!this._height) {
72357235
return null;
72367236
}
7237+
const styles = this.document.defaultView.getComputedStyle(this.nativeElement);
72377238
const actualTheadRow = this.getTheadRowHeight();
72387239
const footerHeight = this.getFooterHeight();
72397240
const toolbarHeight = this.getToolbarHeight();
72407241
const pagingHeight = this.getPagingFooterHeight();
72417242
const groupAreaHeight = this.getGroupAreaHeight();
72427243
const scrHeight = this.getComputedHeight(this.scr.nativeElement);
7244+
const borderTop = parseFloat(styles.getPropertyValue('border-top'));
7245+
const borderBottom = parseFloat(styles.getPropertyValue('border-bottom'));
7246+
72437247
const renderedHeight = toolbarHeight + actualTheadRow +
72447248
footerHeight + pagingHeight + groupAreaHeight +
7245-
scrHeight;
7249+
scrHeight + borderTop + borderBottom;
72467250

72477251
let gridHeight = 0;
72487252

72497253
if (this.isPercentHeight) {
7250-
const computed = this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('height');
7254+
const computed = styles.getPropertyValue('height');
72517255
const autoSize = this._shouldAutoSize(renderedHeight);
72527256
if (autoSize || computed.indexOf('%') !== -1) {
72537257
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)