Skip to content

Commit

Permalink
fix issue with not working last symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
catherineriver committed Mar 30, 2023
1 parent e1775c6 commit 57faee8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@catherineriver/sanity-plugin-generate-ogimage",
"version": "1.0.2",
"version": "1.0.3",
"description": "This is a Sanity Studio v3 plugin.",
"keywords": [
"sanity",
Expand Down
5 changes: 2 additions & 3 deletions src/EditorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,17 @@ const EditorField: React.FC<EditorFieldProps> = ({field, data = {}, updateData,
}

function onChange(e: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>) {
setValue(e.currentTarget.value || '')
if (e.currentTarget.type === 'checkbox' && 'checked' in e.currentTarget) {
setValue(e.currentTarget.checked)
}
if (e.currentTarget.type === 'number') {
setValue(Number(value))
}
e.preventDefault()
updateData({
...data,
[field.name]: value,
[field.name]: e.currentTarget.value,
})
setValue( e.currentTarget.value || '');
}

const commonProps = {
Expand Down

0 comments on commit 57faee8

Please sign in to comment.