From a227231b90b853063f117d30e2a0c757cd222e41 Mon Sep 17 00:00:00 2001 From: Fedor Katurov <gotham48@gmail.com> Date: Wed, 9 Oct 2019 21:29:02 +0700 Subject: [PATCH] tag fixes --- src/components/node/Tags/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/node/Tags/index.tsx b/src/components/node/Tags/index.tsx index 6077b01e..89359e35 100644 --- a/src/components/node/Tags/index.tsx +++ b/src/components/node/Tags/index.tsx @@ -39,13 +39,18 @@ export const Tags: FC<IProps> = ({ tags, is_editable, onTagsChange, ...props }) setInput(data[data.length - 1].title); } - if (key === 'Enter' || key === ',') { + if (key === 'Enter' || key === ',' || key === 'Comma') { setData( uniq([ ...data, ...input .split(',') - .map((title: string) => title.trim().substr(0, 32)) + .map((title: string) => + title + .trim() + .substr(0, 32) + .toLowerCase() + ) .filter(el => el.length > 0) .filter(el => !tags.some(tag => tag.title.trim() === el.trim())) .map(title => ({