Skip to content

Commit 2ef292d

Browse files
authored
Merge pull request #127 from CivicDataLab/126-fix-input-going-out-of-focus-on-pressing-keystroke
add onBlur for textfield
2 parents e7a073c + 41c52b1 commit 2ef292d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components

app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/ResourceSchema.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ const DescriptionCell = ({
3838
}) => {
3939
const [description, setDescription] = React.useState(value || '');
4040

41-
const handleChange = (text: string) => {
42-
setDescription(text);
43-
handleFieldChange('description', text, rowIndex);
41+
const handleChange = (e:any) => {
42+
setDescription(e?.target?.value);
43+
handleFieldChange('description', e?.target?.value, rowIndex);
4444
};
4545

4646
return (
@@ -49,8 +49,8 @@ const DescriptionCell = ({
4949
labelHidden
5050
name="description"
5151
type="text"
52-
value={description}
53-
onChange={(e: any) => handleChange(e)}
52+
defaultValue={description}
53+
onBlur={(e: any) => handleChange(e)}
5454
/>
5555
);
5656
};

0 commit comments

Comments
 (0)