diff --git a/projects/igniteui-angular/src/lib/grids/cell.component.ts b/projects/igniteui-angular/src/lib/grids/cell.component.ts index 21d0c95a50f..f9eb981c652 100644 --- a/projects/igniteui-angular/src/lib/grids/cell.component.ts +++ b/projects/igniteui-angular/src/lib/grids/cell.component.ts @@ -694,6 +694,12 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellT @HostBinding('class.igx-grid__td--row-pinned-first') public displayPinnedChip = false; + @HostBinding('style.min-height.px') + protected get minHeight() { + if ((this.grid as any).isCustomSetRowHeight) { + return this.grid.renderedRowHeight; + } + } @ViewChild('defaultCell', { read: TemplateRef, static: true }) protected defaultCellTemplate: TemplateRef; diff --git a/projects/igniteui-angular/src/lib/grids/grid-base.directive.ts b/projects/igniteui-angular/src/lib/grids/grid-base.directive.ts index 7ecbaf6131d..ba45874059d 100644 --- a/projects/igniteui-angular/src/lib/grids/grid-base.directive.ts +++ b/projects/igniteui-angular/src/lib/grids/grid-base.directive.ts @@ -3228,6 +3228,10 @@ export abstract class IgxGridBaseDirective implements GridType, return MINIMUM_COLUMN_WIDTH; } + protected get isCustomSetRowHeight(): boolean { + return !isNaN(this._rowHeight); + } + /** * @hidden @internal */ diff --git a/projects/igniteui-angular/src/lib/grids/grid/grid.component.spec.ts b/projects/igniteui-angular/src/lib/grids/grid/grid.component.spec.ts index 3d6268bbda2..ce3e8dd5977 100644 --- a/projects/igniteui-angular/src/lib/grids/grid/grid.component.spec.ts +++ b/projects/igniteui-angular/src/lib/grids/grid/grid.component.spec.ts @@ -662,6 +662,17 @@ describe('IgxGrid Component Tests #grid', () => { expect(parseInt(window.getComputedStyle(gridBody.nativeElement).height, 10)).toBeGreaterThan(0); expect(gridBody.nativeElement.innerText).toMatch(grid.emptyGridMessage); })); + + it('should apply correct rowHeight when set as input', () => { + const fixture = TestBed.createComponent(IgxGridTestComponent); + const grid = fixture.componentInstance.grid; + grid.rowHeight = 75; + fixture.detectChanges(); + + const cell = fixture.debugElement.query(By.css(TBODY_CLASS)).query(By.css('.igx-grid__td')).nativeElement; + const expectedCellHeight = 76; // rowHeight + 1px border + expect(cell.offsetHeight).toEqual(expectedCellHeight); + }); }); describe('IgxGrid - virtualization tests', () => { diff --git a/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.virtualization.spec.ts b/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.virtualization.spec.ts index f97dff86967..b9d7937908f 100644 --- a/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.virtualization.spec.ts +++ b/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.virtualization.spec.ts @@ -424,6 +424,7 @@ describe('IgxHierarchicalGrid Virtualization #hGrid', () => { hierarchicalGrid.verticalScrollContainer.getScroll().scrollTop = 2000; fixture.detectChanges(); await wait(50); + fixture.detectChanges(); const hierarchicalGridRect = hierarchicalGrid.tbody.nativeElement.getBoundingClientRect(); const lastRowRect = hierarchicalGrid.dataRowList.last.nativeElement.getBoundingClientRect();