diff --git a/web/src/components/edit-tag/index.tsx b/web/src/components/edit-tag/index.tsx index 1c9f0aee8..aac8143b4 100644 --- a/web/src/components/edit-tag/index.tsx +++ b/web/src/components/edit-tag/index.tsx @@ -37,8 +37,12 @@ const EditTag = ({ tags, setTags }: EditTagsProps) => { }; const handleInputConfirm = () => { - if (inputValue && tags?.indexOf(inputValue) === -1) { - setTags?.([...tags, inputValue]); + if (inputValue && tags) { + const newTags = inputValue + .split(';') + .map((tag) => tag.trim()) + .filter((tag) => tag && !tags.includes(tag)); + setTags?.([...tags, ...newTags]); } setInputVisible(false); setInputValue('');