diff --git a/src/ui/component/publishForm/view.jsx b/src/ui/component/publishForm/view.jsx index c8d5e1c50..9cbcf1553 100644 --- a/src/ui/component/publishForm/view.jsx +++ b/src/ui/component/publishForm/view.jsx @@ -136,7 +136,14 @@ function PublishForm(props: Props) { suggestMature help={__('The better your tags are, the easier it will be for people to discover your content.')} empty={__('No tags added')} - onSelect={tag => updatePublishForm({ tags: [...tags, tag] })} + onSelect={newTag => { + if (!tags.map(savedTag => savedTag.name).includes(newTag.name)) { + updatePublishForm({ tags: [...tags, newTag] }); + } else { + // If it already exists and the user types it in, remove it + updatePublishForm({ tags: tags.filter(tag => tag.name !== newTag.name) }); + } + }} onRemove={clickedTag => { const newTags = tags.slice().filter(tag => tag.name !== clickedTag.name); updatePublishForm({ tags: newTags }); diff --git a/static/locales/en.json b/static/locales/en.json index 36d45198d..9561007b3 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -532,4 +532,4 @@ "View Your Feed": "View Your Feed", "View Your Channels": "View Your Channels", "Unfollow": "Unfollow" -} \ No newline at end of file +}