diff --git a/lib/core/src/lib/datatable/components/datatable/datatable.component.html b/lib/core/src/lib/datatable/components/datatable/datatable.component.html
index 11fff74303..4976da60fa 100644
--- a/lib/core/src/lib/datatable/components/datatable/datatable.component.html
+++ b/lib/core/src/lib/datatable/components/datatable/datatable.component.html
@@ -39,7 +39,7 @@
'adf-datatable__cursor--pointer': !isResizing,
'adf-datatable__header--sorted-asc': isColumnSorted(col, 'asc'),
'adf-datatable__header--sorted-desc': isColumnSorted(col, 'desc')}"
- [ngStyle]="(col.width) && {'flex': getFlexValue(col)}"
+ [ngStyle]="(col.width) && !lastColumn && {'flex': getFlexValue(col)}"
[attr.aria-label]="col.title | translate"
(click)="onColumnHeaderClick(col, $event)"
(keyup.enter)="onColumnHeaderClick(col, $event)"
@@ -103,7 +103,7 @@
+ [ngStyle]="(col.width) && !lastColumn && {'flex': getFlexValue(col)}">
diff --git a/lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts b/lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts
index 099fb08890..e682c4bf33 100644
--- a/lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts
+++ b/lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts
@@ -1738,20 +1738,20 @@ describe('Column Resizing', () => {
});
});
- it('should display resize handle for each column by default', () => {
+ it('should display resize handle for each column, but not for the last one, by default', () => {
dataTable.isResizingEnabled = true;
fixture.detectChanges();
- expect(getResizeHandlersCount()).toBe(2);
+ expect(getResizeHandlersCount()).toBe(1);
});
- it('should NOT display resize handle for the column when the column has resizable param set to false', () => {
+ it('should NOT display resize handle for the column when the column has resizable param set to false and column is not the last one', () => {
dataTable.isResizingEnabled = true;
dataTableSchema[0].resizable = false;
dataTable.data = new ObjectDataTableAdapter([...data], [...dataTableSchema]);
fixture.detectChanges();
- expect(getResizeHandlersCount()).toBe(1);
+ expect(getResizeHandlersCount()).toBe(0);
});
it('should display resize handle when the feature is Enabled [isResizingEnabled=true]', () => {