From f3965da73c495fca26f55153ffb32ea1c8206742 Mon Sep 17 00:00:00 2001 From: Manish Kushare Date: Wed, 25 Jan 2023 18:02:13 +0530 Subject: [PATCH] [ Bug fixed ] - [ Table widget ] showing blank spaces for undefined and null values in the respective cells (#5368) * bug fixed - shwowing blank spaces for undefined and null values in the respective cells * removed the condition for string undefined and null edge case --- frontend/src/Editor/Components/Table/columns/index.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/Editor/Components/Table/columns/index.jsx b/frontend/src/Editor/Components/Table/columns/index.jsx index dabacb08d1..6645b4c33e 100644 --- a/frontend/src/Editor/Components/Table/columns/index.jsx +++ b/frontend/src/Editor/Components/Table/columns/index.jsx @@ -68,7 +68,7 @@ export default function generateColumnsData({ isEditable: column.isEditable, Cell: function (cell) { const rowChangeSet = changeSet ? changeSet[cell.row.index] : null; - const cellValue = rowChangeSet ? rowChangeSet[column.name] || cell.value : cell.value; + let cellValue = rowChangeSet ? rowChangeSet[column.name] || cell.value : cell.value; const rowData = tableData[cell.row.index]; if ( @@ -80,6 +80,8 @@ export default function generateColumnsData({ customResolvables[id] = { ...variablesExposedForPreview[id], rowData }; exposeToCodeHinter((prevState) => ({ ...prevState, ...customResolvables })); } + cellValue = cellValue === undefined || cellValue === null ? '' : cellValue; + switch (columnType) { case 'string': case undefined: @@ -158,7 +160,6 @@ export default function generateColumnsData({ const cellStyles = { color: textColor ?? '', }; - if (column.isEditable) { const validationData = validateWidget({ validationObject: {