From 557073df75a63deaef2004c512ee9ad71acbf0f8 Mon Sep 17 00:00:00 2001 From: Kiran Ashok Date: Mon, 31 Oct 2022 14:13:25 +0530 Subject: [PATCH] Fix :: Closing of textarea ontype Table widget (#4549) * fix :: closing of textarea ontype * fix :: bug not able to clear value --- frontend/src/Editor/Components/Table/columns/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/Editor/Components/Table/columns/index.jsx b/frontend/src/Editor/Components/Table/columns/index.jsx index fbfe60b013..f3898f4adf 100644 --- a/frontend/src/Editor/Components/Table/columns/index.jsx +++ b/frontend/src/Editor/Components/Table/columns/index.jsx @@ -231,12 +231,12 @@ export default function generateColumnsData({ handleCellValueChange(cell.row.index, column.key || column.name, e.target.value, cell.row.original); } }} - onChange={(e) => { - if (column.isEditable) { + onKeyDown={(e) => { + e.persist(); + if (e.key === 'Enter' && column.isEditable) { handleCellValueChange(cell.row.index, column.key || column.name, e.target.value, cell.row.original); } }} - value={cellValue} defaultValue={cellValue} > );