From c58a5c62d9992e7778b7f82e77b8b118c05cded1 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Mon, 11 Oct 2021 10:49:46 +0200 Subject: [PATCH] #142 - Fix for unknown tags --- src/panelWebView/components/Tags.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/panelWebView/components/Tags.tsx b/src/panelWebView/components/Tags.tsx index f60dbf15..9a5091a3 100644 --- a/src/panelWebView/components/Tags.tsx +++ b/src/panelWebView/components/Tags.tsx @@ -16,17 +16,24 @@ export const Tags: React.FunctionComponent = (props: React.PropsWith const knownTags = values.filter(v => options.includes(v)); const unknownTags = values.filter(v => !options.includes(v)); + + const generateKey = (tag: string, idx: number) => { + if (tag) { + return `${tag.replace(/ /g, "_")}-${idx}`; + } + return `tag-${idx}`; + }; return (
{ - knownTags.map(t => ( - + knownTags.map((t, idx) => ( + )) } { - unknownTags.map(t => ( - + unknownTags.map((t, idx) => ( + )) }