fixed bug where trying adding two identical tags just added none
This commit is contained in:
parent
4cea57060e
commit
0caac8e402
1 changed files with 2 additions and 1 deletions
|
@ -62,7 +62,8 @@ export default function TagsSearch(props: Props) {
|
||||||
|
|
||||||
setNewTag('');
|
setNewTag('');
|
||||||
|
|
||||||
tags = tags.split(',').map(newTag => newTag.trim().toLowerCase());
|
// Split into individual tags, normalize the tags, and remove duplicates with sets.
|
||||||
|
tags = [...new Set(tags.split(',').map(newTag => newTag.trim().toLowerCase()))];
|
||||||
tags.forEach(tag => {
|
tags.forEach(tag => {
|
||||||
if (onSelect) {
|
if (onSelect) {
|
||||||
onSelect({ name: tag });
|
onSelect({ name: tag });
|
||||||
|
|
Loading…
Add table
Reference in a new issue