fix: pressing enter on "Display additional results" does the expected thing

This commit is contained in:
Andre Medeiros 2019-03-13 17:05:21 -04:00 committed by Iuri Matias
parent 5816a79ae6
commit 2cc0d305e6
1 changed files with 6 additions and 1 deletions

View File

@ -20,10 +20,15 @@ class Console extends Component {
}
handleSubmit(event) {
const instance = this.typeahead.getInstance();
if(instance.state.selected.length === 0) {
return;
}
event.preventDefault();
this.props.postCommand(this.state.value);
this.setState({value: ''});
this.typeahead.getInstance().clear();
instance.clear();
}
handleChange(value, cb) {