From c3459c40ccbbc0113e199ccd9ff682292937c69c Mon Sep 17 00:00:00 2001
From: jacekpluta <73617938+jacekpluta@users.noreply.github.com>
Date: Mon, 18 Mar 2024 11:45:24 +0100
Subject: [PATCH] [ACS-7242] Resizing columns with panel opened on the right,
e.g. nfo Drawer creates empty columns space when panel is closed. (#9446)
---
.../components/datatable/datatable.component.html | 6 +++---
.../components/datatable/datatable.component.spec.ts | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
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]', () => {