diff --git a/CHANGELOG.md b/CHANGELOG.md index 579344e..52b8c55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Updated group expand and collapse behavior (#161) - Added custom value to editable select field (#165) - Updated group expanding for empty cells (#169) +- Added type check for text area (#172) ## 1.7.0 (2024-11-16) diff --git a/src/components/editors/EditableColumnEditor/EditableColumnEditorsRegistry.test.tsx b/src/components/editors/EditableColumnEditor/EditableColumnEditorsRegistry.test.tsx index a11ce32..318a311 100644 --- a/src/components/editors/EditableColumnEditor/EditableColumnEditorsRegistry.test.tsx +++ b/src/components/editors/EditableColumnEditor/EditableColumnEditorsRegistry.test.tsx @@ -527,6 +527,22 @@ describe('editableColumnEditorsRegistry', () => { expect(onChange).toHaveBeenCalledWith('line updated'); }); + it('Should render control with a non-string type ', () => { + render( + getControlComponent({ + value: null, + config: createColumnEditConfig({ editor: { type: ColumnEditorType.TEXTAREA } }).editor, + }) + ); + + expect(controlSelectors.fieldTextarea()).toBeInTheDocument(); + expect(controlSelectors.fieldTextarea()).toHaveValue('null'); + + fireEvent.change(controlSelectors.fieldTextarea(), { target: { value: 'line updated' } }); + + expect(onChange).toHaveBeenCalledWith('line updated'); + }); + it('Should render control with replaced lines and replace line onChange correctly', () => { render( getControlComponent({ diff --git a/src/components/editors/EditableColumnEditor/EditableColumnEditorsRegistry.tsx b/src/components/editors/EditableColumnEditor/EditableColumnEditorsRegistry.tsx index e333e4d..7e2e169 100644 --- a/src/components/editors/EditableColumnEditor/EditableColumnEditorsRegistry.tsx +++ b/src/components/editors/EditableColumnEditor/EditableColumnEditorsRegistry.tsx @@ -56,7 +56,7 @@ export const editableColumnEditorsRegistry = createEditableColumnEditorsRegistry editor: () => null, control: ({ value, onChange, isSaving }) => (