Skip to content

Commit 217b57f

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Simplify some more. Add null checks.
1 parent 30a5d96 commit 217b57f

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

projects/igniteui-angular/grids/core/src/columns/column.component.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,7 +2679,7 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
26792679
} else if (this.minWidth && newSize <= this.userSetMinWidthPx) {
26802680
this.widthConstrained = true;
26812681
return this.userSetMinWidthPx;
2682-
} else if (!this.minWidth && (!this.widthSetByUser || this.width === 'fit-content') && newSize <= this.grid.minColumnWidth) {
2682+
} else if (!this.minWidth && (!this.widthSetByUser || this.width === 'fit-content') && (!newSize || newSize <= this.grid.minColumnWidth)) {
26832683
return this.grid.minColumnWidth;
26842684
} else {
26852685
this.widthConstrained = false;
@@ -2700,20 +2700,10 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
27002700
} else if (isPercentageWidth) {
27012701
const currentCalcWidth = parseFloat(colWidth) / 100 * this.grid.calcWidth;
27022702
this._calcWidth = this.grid.calcWidth ? this.getConstrainedSizePx(currentCalcWidth) : 0;
2703-
} else if (!colWidth || isAutoWidth && !this.autoSize) {
2703+
} else {
27042704
// no width
27052705
const currentCalcWidth = this.defaultWidth || this.grid.getPossibleColumnWidth();
27062706
this._calcWidth = this.getConstrainedSizePx(parseFloat(currentCalcWidth));
2707-
} else {
2708-
let possibleColumnWidth = '';
2709-
if (!this.widthSetByUser && this.userSetMinWidthPx && this.userSetMinWidthPx < this.grid.minColumnWidth) {
2710-
possibleColumnWidth = this.defaultWidth = this.grid.getPossibleColumnWidth();
2711-
} else {
2712-
possibleColumnWidth = this.width;
2713-
}
2714-
2715-
const currentCalcWidth = parseFloat(possibleColumnWidth);
2716-
this._calcWidth = this.getConstrainedSizePx(currentCalcWidth);
27172707
}
27182708
this.calcPixelWidth = parseFloat(this._calcWidth);
27192709
}

0 commit comments

Comments
 (0)