Skip to content

Commit 32d14f0

Browse files
Svetoslav KrastevSvetoslav Krastev
authored andcommitted
chore(*): Add check if rowDimensions array is empty.
1 parent 3923531 commit 32d14f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,9 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
11561156
}
11571157

11581158
public get pivotContentCalcWidth() {
1159-
const totalDimWidth = this.rowDimensions.map((dim) => this.rowDimensionWidthToPixels(dim)).reduce((prev, cur) => prev + cur);
1159+
const totalDimWidth = this.rowDimensions.length > 0 ?
1160+
this.rowDimensions.map((dim) => this.rowDimensionWidthToPixels(dim)).reduce((prev, cur) => prev + cur) :
1161+
0;
11601162
return this.calcWidth - totalDimWidth;
11611163
}
11621164

0 commit comments

Comments
 (0)