Skip to content

Commit 125f9c0

Browse files
author
INFRAGISTICS\tiliev
committed
fix(IgxGrid): Fixed failing MCH width tests. #488
1 parent 5147fc0 commit 125f9c0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

projects/igniteui-angular/src/lib/grid/column.component.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,19 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
533533
}
534534

535535
get width() {
536-
return `${this.children.reduce((acc, val) => acc + (!val.hidden ? parseInt(val.width, 10) : 0), 0)}`;
536+
let isChildrenWidthInPercent = false;
537+
const width = `${this.children.reduce((acc, val) => {
538+
if (val.hidden) {
539+
return acc;
540+
}
541+
542+
if (val.width && val.width.indexOf('%') !== -1) {
543+
isChildrenWidthInPercent = true;
544+
}
545+
546+
return acc + parseInt(val.width, 10);
547+
}, 0)}`;
548+
return isChildrenWidthInPercent ? width + '%' : width;
537549
}
538550

539551
set width(val) {}

0 commit comments

Comments
 (0)