Skip to content

Commit

Permalink
fix: [PROD-11885] Fix empty table cells when option is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Guismus committed Jul 27, 2023
1 parent da0ef2a commit 2094153
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/inputs/Table/ColumnTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@

import { DateUtils } from '@cosmotech/core';

const _editModeSetter = (params) => {
let newValue = params.newValue;
if (!params.context.editMode) {
newValue = params.oldValue;
}
params.data[params.colDef.field] = newValue;
return true;
};

const _stringSetter = (params) => {
let newValue = params.newValue?.trim() ?? '';
const unauthorizedEmptyField = newValue.length === 0 && !params.colDef.cellEditorParams?.acceptsEmptyFields;
Expand Down Expand Up @@ -149,7 +140,7 @@ export const getDefaultColumnsProperties = (onCellChange, classes) => {
resizable: true,
sortable: true,
filter: 'agTextColumnFilter',
valueSetter: _editModeSetter,
valueSetter: _stringSetter,
onCellValueChanged: (event) => {
onCellChange(event);
},
Expand Down

0 comments on commit 2094153

Please sign in to comment.