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 => {
|
const onSubmit = tag => {
|
||||||
// Just 'undraft' the current draft tag
|
const { draft, ...toSubmit } = { ...draftTag, value: tag };
|
||||||
const { draft, ...undrafted } = draftTag;
|
if (draftTag.value.trim().length === 0) {
|
||||||
props.onUpdateBody(draftTag, undrafted);
|
props.onAppendBody(toSubmit);
|
||||||
|
} else {
|
||||||
|
props.onUpdateBody(draftTag, toSubmit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue