diff --git a/client/homebrew/editor/tagInput/tagInput.jsx b/client/homebrew/editor/tagInput/tagInput.jsx index f42e2f62f..03678961d 100644 --- a/client/homebrew/editor/tagInput/tagInput.jsx +++ b/client/homebrew/editor/tagInput/tagInput.jsx @@ -26,6 +26,11 @@ const TagInput = ({ unique = true, values = [], ...props }) => { const submitTag = (newValue, originalValue) => { setValueContext((prevContext) => { + // remove existing tag + if(newValue === null){ + console.log('remove'); + return [...prevContext].filter((context)=>context.value !== originalValue); + } // add new tag if(originalValue === null){ return [...prevContext, { value: newValue, editing: false }] @@ -58,6 +63,7 @@ const TagInput = ({ unique = true, values = [], ...props }) => { className='tag' onClick={() => editTag(context.value)}> {context.value} + ); };