@@ -3228,7 +3228,7 @@ export abstract class IgxGridBaseDirective implements GridType,
32283228 private overlayIDs = [ ] ;
32293229 private _sortingStrategy : IGridSortingStrategy ;
32303230 private _pinning : IPinningConfig = { columns : ColumnPinningPosition . Start } ;
3231- private _shouldRecalcRowHeight = false ;
3231+ private _shouldRecalcDefaultSizes = false ;
32323232
32333233 private _hostWidth ;
32343234 private _advancedFilteringOverlayId : string ;
@@ -3302,6 +3302,7 @@ export abstract class IgxGridBaseDirective implements GridType,
33023302 private _sortDescendingHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
33033303 private _gridSize : Size = Size . Large ;
33043304 private _defaultRowHeight = 50 ;
3305+ private _defaultCellPadding = 48 ;
33053306
33063307 /**
33073308 * @hidden @internal
@@ -3720,7 +3721,7 @@ export abstract class IgxGridBaseDirective implements GridType,
37203721 if ( this . shouldResize ) {
37213722 // resizing occurs due to the change of --ig-size css var
37223723 this . _gridSize = this . gridSize ;
3723- this . updateDefaultRowHeight ( ) ;
3724+ this . updateDefaultSizes ( ) ;
37243725 this . _autoSize = this . isPercentHeight && this . calcHeight !== this . getDataBasedBodyHeight ( ) ;
37253726 this . crudService . endEdit ( false ) ;
37263727 if ( this . _summaryRowHeight === 0 ) {
@@ -3956,7 +3957,7 @@ export abstract class IgxGridBaseDirective implements GridType,
39563957 */
39573958 public dataRebinding ( event : IForOfDataChangeEventArgs ) {
39583959 if ( event . state . chunkSize == 0 ) {
3959- this . _shouldRecalcRowHeight = true ;
3960+ this . _shouldRecalcDefaultSizes = true ;
39603961 }
39613962 this . dataChanging . emit ( event ) ;
39623963 }
@@ -3966,9 +3967,9 @@ export abstract class IgxGridBaseDirective implements GridType,
39663967 */
39673968 public dataRebound ( event : IForOfDataChangeEventArgs ) {
39683969 this . selectionService . clearHeaderCBState ( ) ;
3969- if ( this . _shouldRecalcRowHeight ) {
3970- this . _shouldRecalcRowHeight = false ;
3971- this . updateDefaultRowHeight ( ) ;
3970+ if ( this . _shouldRecalcDefaultSizes ) {
3971+ this . _shouldRecalcDefaultSizes = false ;
3972+ this . updateDefaultSizes ( ) ;
39723973 }
39733974 this . dataChanged . emit ( event ) ;
39743975 }
@@ -4400,14 +4401,7 @@ export abstract class IgxGridBaseDirective implements GridType,
44004401 * The values below depend on the header cell default right/left padding values.
44014402 */
44024403 public get defaultHeaderGroupMinWidth ( ) : number {
4403- switch ( this . gridSize ) {
4404- case Size . Medium :
4405- return 32 ;
4406- case Size . Small :
4407- return 24 ;
4408- default :
4409- return 48 ;
4410- }
4404+ return this . _defaultCellPadding ;
44114405 }
44124406
44134407 /** @hidden @internal */
@@ -7838,13 +7832,15 @@ export abstract class IgxGridBaseDirective implements GridType,
78387832 this . _lastSearchInfo . matchCount = this . _lastSearchInfo . matchInfoCache . length ;
78397833 }
78407834
7841- protected updateDefaultRowHeight ( ) {
7835+ protected updateDefaultSizes ( ) {
78427836 if ( this . dataRowList . length > 0 && this . dataRowList . first . cells && this . dataRowList . first . cells . length > 0 ) {
78437837 const height = parseFloat ( this . document . defaultView . getComputedStyle ( this . dataRowList . first . cells . first . nativeElement ) ?. getPropertyValue ( 'height' ) ) ;
7844- if ( height ) {
7838+ const padding = parseFloat ( this . document . defaultView . getComputedStyle ( this . dataRowList . first . cells . first . nativeElement ) ?. getPropertyValue ( 'padding-left' ) ) ;
7839+ if ( height && padding ) {
78457840 this . _defaultRowHeight = height ;
7841+ this . _defaultCellPadding = padding * 2 ;
78467842 } else {
7847- this . _shouldRecalcRowHeight = true ;
7843+ this . _shouldRecalcDefaultSizes = true ;
78487844 }
78497845 }
78507846 }
0 commit comments