Allows quick entry of entities separated by commas (#3914)

Allows quick entry of entities separated by commas

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
so95 2024-12-10 09:29:27 +07:00 committed by GitHub
parent 3e134ac0ad
commit 5fe0791684
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,8 +37,12 @@ const EditTag = ({ tags, setTags }: EditTagsProps) => {
}; };
const handleInputConfirm = () => { const handleInputConfirm = () => {
if (inputValue && tags?.indexOf(inputValue) === -1) { if (inputValue && tags) {
setTags?.([...tags, inputValue]); const newTags = inputValue
.split(';')
.map((tag) => tag.trim())
.filter((tag) => tag && !tags.includes(tag));
setTags?.([...tags, ...newTags]);
} }
setInputVisible(false); setInputVisible(false);
setInputValue(''); setInputValue('');