@@ -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 }
0 commit comments