@@ -4635,14 +4635,37 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46354635 return 0 ;
46364636 }
46374637
4638+ /**
4639+ * @hidden
4640+ */
4641+ protected getComputedHeight ( elem ) {
4642+ return elem . offsetHeight ? parseFloat ( this . document . defaultView . getComputedStyle ( elem ) . getPropertyValue ( 'height' ) ) : 0 ;
4643+ }
4644+ /**
4645+ * @hidden
4646+ */
4647+ protected getFooterHeight ( ) : number {
4648+ return this . summariesHeight || this . getComputedHeight ( this . tfoot . nativeElement ) ;
4649+ }
4650+ /**
4651+ * @hidden
4652+ */
4653+ protected getTheadRowHeight ( ) : number {
4654+ const height = this . getComputedHeight ( this . theadRow . nativeElement ) ;
4655+ return ( ! this . allowFiltering || ( this . allowFiltering && this . filterMode !== FilterMode . quickFilter ) ) ?
4656+ height - this . getFilterCellHeight ( ) :
4657+ height ;
4658+ }
4659+
46384660 /**
46394661 * @hidden
46404662 */
46414663 protected getToolbarHeight ( ) : number {
46424664 let toolbarHeight = 0 ;
46434665 if ( this . showToolbar && this . toolbarHtml != null ) {
4666+ const height = this . getComputedHeight ( this . toolbarHtml . nativeElement ) ;
46444667 toolbarHeight = this . toolbarHtml . nativeElement . firstElementChild ?
4645- this . toolbarHtml . nativeElement . offsetHeight : 0 ;
4668+ height : 0 ;
46464669 }
46474670 return toolbarHeight ;
46484671 }
@@ -4653,8 +4676,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46534676 protected getPagingFooterHeight ( ) : number {
46544677 let pagingHeight = 0 ;
46554678 if ( this . footer ) {
4679+ const height = this . getComputedHeight ( this . footer . nativeElement ) ;
46564680 pagingHeight = this . footer . nativeElement . firstElementChild ?
4657- this . footer . nativeElement . offsetHeight : 0 ;
4681+ height : 0 ;
46584682 }
46594683 return pagingHeight ;
46604684 }
@@ -4677,17 +4701,15 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46774701 if ( ! this . _height ) {
46784702 return null ;
46794703 }
4680-
4681- const actualTheadRow = ( ! this . allowFiltering || ( this . allowFiltering && this . filterMode !== FilterMode . quickFilter ) ) ?
4682- this . theadRow . nativeElement . offsetHeight - this . getFilterCellHeight ( ) :
4683- this . theadRow . nativeElement . offsetHeight ;
4684- const footerHeight = this . summariesHeight || this . tfoot . nativeElement . offsetHeight - this . tfoot . nativeElement . clientHeight ;
4704+ const actualTheadRow = this . getTheadRowHeight ( ) ;
4705+ const footerHeight = this . getFooterHeight ( ) ;
46854706 const toolbarHeight = this . getToolbarHeight ( ) ;
46864707 const pagingHeight = this . getPagingFooterHeight ( ) ;
46874708 const groupAreaHeight = this . getGroupAreaHeight ( ) ;
4709+ const scrHeight = this . getComputedHeight ( this . scr . nativeElement ) ;
46884710 const renderedHeight = toolbarHeight + actualTheadRow +
46894711 footerHeight + pagingHeight + groupAreaHeight +
4690- this . scr . nativeElement . clientHeight ;
4712+ scrHeight ;
46914713
46924714 let gridHeight = 0 ;
46934715
@@ -4698,13 +4720,13 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46984720 const bodyHeight = this . getDataBasedBodyHeight ( ) ;
46994721 return bodyHeight > 0 ? bodyHeight : null ;
47004722 }
4701- gridHeight = parseInt ( computed , 10 ) ;
4723+ gridHeight = parseFloat ( computed ) ;
47024724 } else {
47034725 gridHeight = parseInt ( this . _height , 10 ) ;
47044726 }
47054727 const height = Math . abs ( gridHeight - renderedHeight ) ;
47064728
4707- if ( height === 0 || isNaN ( gridHeight ) ) {
4729+ if ( Math . round ( height ) === 0 || isNaN ( gridHeight ) ) {
47084730 const bodyHeight = this . defaultTargetBodyHeight ;
47094731 return bodyHeight > 0 ? bodyHeight : null ;
47104732 }
0 commit comments