From 19c13342c47a8435bca94fb350eaec9de35eb8b0 Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Wed, 17 Nov 2021 23:56:57 -0600 Subject: [PATCH] Add autoFocus functionality when editing tags and allow for multi-tag entry by comma separation #758 --- client/homebrew/editor/metadataEditor/metadataEditor.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.jsx b/client/homebrew/editor/metadataEditor/metadataEditor.jsx index 4156bd3cc..4ca3c89f0 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.jsx +++ b/client/homebrew/editor/metadataEditor/metadataEditor.jsx @@ -182,7 +182,7 @@ const MetadataEditor = createClass({ }, addTag : function(tag){ - this.props.metadata.tags = _.uniq([...this.props.metadata.tags, tag]); + this.props.metadata.tags = _.uniq([...this.props.metadata.tags, ...(tag.split(',').map((t)=>t.trim()))]); this.props.onChange(this.props.metadata); }, removeTag : function(tag){ @@ -216,7 +216,7 @@ const MetadataEditor = createClass({ renderTags : function(){ const tagElements = Object.values(this.state.tagContext).map((context, i)=>context.editing - ? { this.handleTagInputKeyDown(e, i); }}