Fixes issue reported in https://github.com/recogito/annotorious/issues/57
This commit is contained in:
parent
a3e95454ef
commit
6507ef4b73
|
@ -51,9 +51,12 @@ const TagWidget = props => {
|
|||
}
|
||||
|
||||
const onSubmit = tag => {
|
||||
// Just 'undraft' the current draft tag
|
||||
const { draft, ...undrafted } = draftTag;
|
||||
props.onUpdateBody(draftTag, undrafted);
|
||||
const { draft, ...toSubmit } = { ...draftTag, value: tag };
|
||||
if (draftTag.value.trim().length === 0) {
|
||||
props.onAppendBody(toSubmit);
|
||||
} else {
|
||||
props.onUpdateBody(draftTag, toSubmit);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue