From 41c52b1d81e69e9641d08df6ead408db76bcc788 Mon Sep 17 00:00:00 2001 From: aashimgarg Date: Mon, 3 Jun 2024 14:12:44 +0530 Subject: [PATCH] add onBlur for textfield --- .../dataset/[id]/edit/components/ResourceSchema.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/ResourceSchema.tsx b/app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/ResourceSchema.tsx index 132f7479..dc641bef 100644 --- a/app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/ResourceSchema.tsx +++ b/app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/ResourceSchema.tsx @@ -38,9 +38,9 @@ const DescriptionCell = ({ }) => { const [description, setDescription] = React.useState(value || ''); - const handleChange = (text: string) => { - setDescription(text); - handleFieldChange('description', text, rowIndex); + const handleChange = (e:any) => { + setDescription(e?.target?.value); + handleFieldChange('description', e?.target?.value, rowIndex); }; return ( @@ -49,8 +49,8 @@ const DescriptionCell = ({ labelHidden name="description" type="text" - value={description} - onChange={(e: any) => handleChange(e)} + defaultValue={description} + onBlur={(e: any) => handleChange(e)} /> ); };