mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +00:00
Add autoFocus functionality when editing tags and allow for multi-tag entry by comma separation
#758
This commit is contained in:
@@ -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
|
||||
? <input type='text' className='value'
|
||||
? <input type='text' className='value' autoFocus
|
||||
value={this.state.updateTag}
|
||||
key={i}
|
||||
onKeyDown={(e)=>{ this.handleTagInputKeyDown(e, i); }}
|
||||
|
||||
Reference in New Issue
Block a user