Skip to content

Commit 2aaeea8

Browse files
Merge branch 'master' into aahmedov/fix-touched-invalid-color-follow-up-master
2 parents 5610a6f + 5d3c371 commit 2aaeea8

File tree

5 files changed

+15
-34
lines changed

5 files changed

+15
-34
lines changed

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

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,9 +2277,6 @@ export abstract class IgxGridBaseDirective implements GridType,
22772277
this._allowFiltering = value;
22782278
this.filteringService.registerSVGIcons();
22792279

2280-
if (!this._init) {
2281-
this.calcGridHeadRow();
2282-
}
22832280

22842281
this.filteringService.isFilterRowVisible = false;
22852282
this.filteringService.filteredColumn = null;
@@ -6859,25 +6856,11 @@ export abstract class IgxGridBaseDirective implements GridType,
68596856
}
68606857
}
68616858

6862-
/**
6863-
* @hidden
6864-
* @internal
6865-
*/
6866-
protected calcGridHeadRow() {
6867-
if (this.maxLevelHeaderDepth) {
6868-
this._baseFontSize = parseFloat(getComputedStyle(this.document.documentElement).getPropertyValue('font-size'));
6869-
const hasFilterRow = this._allowFiltering && this._filterMode === FilterMode.quickFilter;
6870-
const minSize = (this.maxLevelHeaderDepth + 1 + (hasFilterRow ? 1 : 0)) * this.defaultRowHeight / this._baseFontSize;
6871-
this.theadRow.nativeElement.style.minHeight = `${minSize}rem`;
6872-
}
6873-
}
6874-
68756859
/**
68766860
* @hidden
68776861
* Sets TBODY height i.e. this.calcHeight
68786862
*/
68796863
protected calculateGridHeight() {
6880-
this.calcGridHeadRow();
68816864

68826865
this.calcHeight = this._calculateGridBodyHeight();
68836866
if (this.pinnedRowHeight && this.calcHeight) {
@@ -7805,7 +7788,7 @@ export abstract class IgxGridBaseDirective implements GridType,
78057788
} else {
78067789
this._shouldRecalcRowHeight = true;
78077790
}
7808-
}
7791+
}
78097792
}
78107793

78117794
// TODO: About to Move to CRUD

projects/igniteui-angular/src/lib/grids/grid/column-group.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ describe('IgxGrid - multi-column headers #grid', () => {
6767
expect(grid.getColumnByName('ContactName').level).toEqual(expectedLevel);
6868
});
6969

70+
it('should initialize a grid with correct header height', () => {
71+
fixture = TestBed.createComponent(ColumnGroupTestComponent);
72+
fixture.detectChanges();
73+
grid = fixture.componentInstance.grid;
74+
75+
const expectedGridHeaderHeight = 151;
76+
const headerHeight = grid.nativeElement
77+
.querySelector("igx-grid-header-row")
78+
.getBoundingClientRect().height;
79+
80+
expect(Math.round(headerHeight)).toEqual(expectedGridHeaderHeight);
81+
});
82+
7083
it('Should render column group headers correctly.', fakeAsync(() => {
7184
fixture = TestBed.createComponent(BlueWhaleGridComponent);
7285
fixture.detectChanges();

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,6 +2746,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
27462746

27472747
GridFunctions.clickFilterCellChip(fix, 'AnotherField');
27482748
fix.detectChanges();
2749+
grid.cdr.detectChanges();
27492750

27502751
// check if it is positioned at the bottom of the thead.
27512752
const theadWrapper = grid.theadRow.nativeElement.firstElementChild;

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,6 @@ export class IgxGridHeaderComponent implements DoCheck, OnDestroy {
109109
return this.selected;
110110
}
111111

112-
@HostBinding('style.height.rem')
113-
public get height() {
114-
if (!this.grid.hasColumnGroups || this.grid.type === 'pivot') {
115-
return null;
116-
}
117-
118-
return (this.grid.maxLevelHeaderDepth + 1 - this.column.level) * this.grid.defaultRowHeight / this.grid._baseFontSize;
119-
}
120-
121112
/**
122113
* @hidden
123114
*/

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,13 +2106,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
21062106
}
21072107
}
21082108

2109-
/**
2110-
* @hidden
2111-
* @internal
2112-
*/
2113-
protected override calcGridHeadRow() {
2114-
}
2115-
21162109
protected override buildDataView(data: any[]) {
21172110
this._dataView = data;
21182111
}

0 commit comments

Comments
 (0)