cancel tag editor on escape key

This commit is contained in:
or-else
2018-03-28 16:39:22 -07:00
parent 757b23356c
commit ba4f976e3b
+2 -1
View File
@@ -913,7 +913,7 @@
if (this.props.onEnter) { if (this.props.onEnter) {
this.props.onEnter(this.state.input); this.props.onEnter(this.state.input);
} }
} else if (e.keyCode === 27) { } else if (e.key === 'Escape') {
if (this.props.onCancel) { if (this.props.onCancel) {
this.props.onCancel(); this.props.onCancel();
} }
@@ -1643,6 +1643,7 @@
avatarDisabled={true} avatarDisabled={true}
prompt={this.state.noTagsMessage} prompt={this.state.noTagsMessage}
onEnter={this.handleAddTag} onEnter={this.handleAddTag}
onCancel={this.handleCancel}
onChipRemoved={this.handleRemoveTag} onChipRemoved={this.handleRemoveTag}
filterFunc={this.handleTagInput} /> filterFunc={this.handleTagInput} />
{this.props.onSubmit || this.props.onCancel ? {this.props.onSubmit || this.props.onCancel ?