Skip to content

Commit 6c02dd6

Browse files
authored
Merge branch '10.0.x' into mdragnev/fix-7951-10.0.x
2 parents e9de5d5 + 87ad5df commit 6c02dd6

File tree

4 files changed

+48
-14
lines changed

4 files changed

+48
-14
lines changed

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

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4655,14 +4655,37 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46554655
return 0;
46564656
}
46574657

4658+
/**
4659+
* @hidden
4660+
*/
4661+
protected getComputedHeight(elem) {
4662+
return elem.offsetHeight ? parseFloat(this.document.defaultView.getComputedStyle(elem).getPropertyValue('height')) : 0;
4663+
}
4664+
/**
4665+
* @hidden
4666+
*/
4667+
protected getFooterHeight(): number {
4668+
return this.summariesHeight || this.getComputedHeight(this.tfoot.nativeElement);
4669+
}
4670+
/**
4671+
* @hidden
4672+
*/
4673+
protected getTheadRowHeight(): number {
4674+
const height = this.getComputedHeight(this.theadRow.nativeElement);
4675+
return (!this.allowFiltering || (this.allowFiltering && this.filterMode !== FilterMode.quickFilter)) ?
4676+
height - this.getFilterCellHeight() :
4677+
height;
4678+
}
4679+
46584680
/**
46594681
* @hidden
46604682
*/
46614683
protected getToolbarHeight(): number {
46624684
let toolbarHeight = 0;
46634685
if (this.showToolbar && this.toolbarHtml != null) {
4686+
const height = this.getComputedHeight(this.toolbarHtml.nativeElement);
46644687
toolbarHeight = this.toolbarHtml.nativeElement.firstElementChild ?
4665-
this.toolbarHtml.nativeElement.offsetHeight : 0;
4688+
height : 0;
46664689
}
46674690
return toolbarHeight;
46684691
}
@@ -4673,8 +4696,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46734696
protected getPagingFooterHeight(): number {
46744697
let pagingHeight = 0;
46754698
if (this.footer) {
4699+
const height = this.getComputedHeight(this.footer.nativeElement);
46764700
pagingHeight = this.footer.nativeElement.firstElementChild ?
4677-
this.footer.nativeElement.offsetHeight : 0;
4701+
height : 0;
46784702
}
46794703
return pagingHeight;
46804704
}
@@ -4697,17 +4721,15 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46974721
if (!this._height) {
46984722
return null;
46994723
}
4700-
4701-
const actualTheadRow = (!this.allowFiltering || (this.allowFiltering && this.filterMode !== FilterMode.quickFilter)) ?
4702-
this.theadRow.nativeElement.offsetHeight - this.getFilterCellHeight() :
4703-
this.theadRow.nativeElement.offsetHeight;
4704-
const footerHeight = this.summariesHeight || this.tfoot.nativeElement.offsetHeight - this.tfoot.nativeElement.clientHeight;
4724+
const actualTheadRow = this.getTheadRowHeight();
4725+
const footerHeight = this.getFooterHeight();
47054726
const toolbarHeight = this.getToolbarHeight();
47064727
const pagingHeight = this.getPagingFooterHeight();
47074728
const groupAreaHeight = this.getGroupAreaHeight();
4729+
const scrHeight = this.getComputedHeight(this.scr.nativeElement);
47084730
const renderedHeight = toolbarHeight + actualTheadRow +
47094731
footerHeight + pagingHeight + groupAreaHeight +
4710-
this.scr.nativeElement.clientHeight;
4732+
scrHeight;
47114733

47124734
let gridHeight = 0;
47134735

@@ -4718,13 +4740,13 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
47184740
const bodyHeight = this.getDataBasedBodyHeight();
47194741
return bodyHeight > 0 ? bodyHeight : null;
47204742
}
4721-
gridHeight = parseInt(computed, 10);
4743+
gridHeight = parseFloat(computed);
47224744
} else {
47234745
gridHeight = parseInt(this._height, 10);
47244746
}
47254747
const height = Math.abs(gridHeight - renderedHeight);
47264748

4727-
if (height === 0 || isNaN(gridHeight)) {
4749+
if (Math.round(height) === 0 || isNaN(gridHeight)) {
47284750
const bodyHeight = this.defaultTargetBodyHeight;
47294751
return bodyHeight > 0 ? bodyHeight : null;
47304752
}

projects/igniteui-angular/src/lib/grids/grid/grid.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
915915
* @hidden @internal
916916
*/
917917
protected getGroupAreaHeight(): number {
918-
return this.groupArea ? this.groupArea.nativeElement.offsetHeight : 0;
918+
return this.groupArea ? this.getComputedHeight(this.groupArea.nativeElement) : 0;
919919
}
920920

921921
/**

src/app/grid-column-moving/grid-column-moving.sample.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@
1010
margin-bottom: 16px;
1111
max-width: 900px;
1212
}
13+
14+
.references {
15+
font-size: .75em;
16+
}
17+
18+
.references > p {
19+
margin: 0;
20+
letter-spacing: initial;
21+
line-height: initial;
22+
font-size: 1em;
23+
}

src/app/grid-column-moving/grid-column-moving.sample.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
[filterMode]="'excelStyleFilter'"
2323
[paging]="false"
2424
[width]="'900px'"
25-
[height]="'800px'">
25+
>
2626
<igx-column *ngFor="let c of columns" [field]="c.field"
2727
[header]="c.field"
2828
[movable]="c.movable"
@@ -37,8 +37,9 @@
3737
[dataType]="c.type">
3838
</igx-column>
3939
<igx-grid-footer>
40-
<div style='height:200px;'>
41-
Test
40+
<div class="references">
41+
<p>Test</p>
42+
<p>Test2</p>
4243
</div>
4344
</igx-grid-footer>
4445
</igx-grid>

0 commit comments

Comments
 (0)