mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 00:42:47 +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){
|
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);
|
this.props.onChange(this.props.metadata);
|
||||||
},
|
},
|
||||||
removeTag : function(tag){
|
removeTag : function(tag){
|
||||||
@@ -216,7 +216,7 @@ const MetadataEditor = createClass({
|
|||||||
|
|
||||||
renderTags : function(){
|
renderTags : function(){
|
||||||
const tagElements = Object.values(this.state.tagContext).map((context, i)=>context.editing
|
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}
|
value={this.state.updateTag}
|
||||||
key={i}
|
key={i}
|
||||||
onKeyDown={(e)=>{ this.handleTagInputKeyDown(e, i); }}
|
onKeyDown={(e)=>{ this.handleTagInputKeyDown(e, i); }}
|
||||||
|
|||||||
Reference in New Issue
Block a user