From 3cd80047be277304dfcf52f6274af8878f0f9cba Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Mon, 8 Jul 2024 07:13:39 +0100 Subject: [PATCH] fix: Custom cell render fails with plain string Cell of width zero should never render. Signed-off-by: Gordon Smith --- packages/dgrid/src/Table.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dgrid/src/Table.ts b/packages/dgrid/src/Table.ts index 6795f88757..e11b0d2d0b 100644 --- a/packages/dgrid/src/Table.ts +++ b/packages/dgrid/src/Table.ts @@ -58,7 +58,7 @@ export class ColumnFormat extends PropertyExt { d3Select(cellElement) .style("background", background) .style("color", Palette.textColor(background)) - .text(cellText.html ? cellText.html : cell) + .text(cellText?.html ?? cellText ?? cell) ; }; } @@ -184,7 +184,7 @@ export class Table extends Common { } } } - this._dgrid.set("columns", this._columns); + this._dgrid.set("columns", this._columns.filter(col => !col.hidden)); this._colsRefresh = false; } if (this._colsRefresh || this._dataRefresh) {