diff --git a/src/components/Table/GridTable.test.tsx b/src/components/Table/GridTable.test.tsx index 9ce43cbb3..a3c738009 100644 --- a/src/components/Table/GridTable.test.tsx +++ b/src/components/Table/GridTable.test.tsx @@ -3839,8 +3839,8 @@ describe("GridTable", () => { `foo,1,1,"1,1","a quoted ""1"" value",1,`, `bar,2,2,"2,2","a quoted ""2"" value",2,`, `zeroname,0,0,"0,0","a quoted ""0"" value",0,`, - `nullname,,null,"null,null","a quoted ""null"" value",-,`, - `undefname,,undefined,"undefined,undefined","a quoted ""undefined"" value",-,`, + `nullname,,null,"null,null","a quoted ""null"" value",,`, + `undefname,,undefined,"undefined,undefined","a quoted ""undefined"" value",,`, ]); }); diff --git a/src/components/Table/GridTableApi.ts b/src/components/Table/GridTableApi.ts index bc35e9f82..0cda89472 100644 --- a/src/components/Table/GridTableApi.ts +++ b/src/components/Table/GridTableApi.ts @@ -247,7 +247,7 @@ export class GridTableApiImpl implements GridTableApi { // Anything not isJSX (like a string) we can put into the CSV directly if (!isJSX(content)) return content; // Otherwise use the value/sortValue values - return isDefined(cell.value) ? maybeApply(cell.value) : cell.sortValue ? maybeApply(cell.sortValue) : "-"; + return isDefined(cell.value) ? maybeApply(cell.value) : cell.sortValue ? maybeApply(cell.sortValue) : "-"; // Do we need the "-" handling unclear if we use it ever } else { // ReactNode return isJSX(maybeContent) ? "-" : maybeContent;