Fix tag replacement

This commit is contained in:
Elio Struyf
2021-10-25 10:24:08 +02:00
parent a7aab96f0e
commit 7291e6aac6
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ const Tags: React.FunctionComponent<ITagsProps> = (props: React.PropsWithChildre
const unknownTags = values.filter(v => !options.includes(v));
const generateKey = (tag: string, idx: number) => {
if (tag) {
if (tag && typeof tag === 'string') {
return `${tag.replace(/ /g, "_")}-${idx}`;
}
return `tag-${idx}`;