Allows quick entry of entities separated by commas (#3914)
Browse filesAllows quick entry of entities separated by commas
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
web/src/components/edit-tag/index.tsx
CHANGED
@@ -37,8 +37,12 @@ const EditTag = ({ tags, setTags }: EditTagsProps) => {
|
|
37 |
};
|
38 |
|
39 |
const handleInputConfirm = () => {
|
40 |
-
if (inputValue && tags
|
41 |
-
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
setInputVisible(false);
|
44 |
setInputValue('');
|
|
|
37 |
};
|
38 |
|
39 |
const handleInputConfirm = () => {
|
40 |
+
if (inputValue && tags) {
|
41 |
+
const newTags = inputValue
|
42 |
+
.split(';')
|
43 |
+
.map((tag) => tag.trim())
|
44 |
+
.filter((tag) => tag && !tags.includes(tag));
|
45 |
+
setTags?.([...tags, ...newTags]);
|
46 |
}
|
47 |
setInputVisible(false);
|
48 |
setInputValue('');
|