This commit is contained in:
Rainer Simon 2020-09-24 14:55:01 +02:00
parent a3e95454ef
commit 6507ef4b73
1 changed files with 6 additions and 3 deletions

View File

@ -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 (