fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 232 forks source link

On re-select the text-input the first option of the list gets selected by default #190

Open tanmay-cs13 opened 8 years ago

tanmay-cs13 commented 8 years ago

Function _onTextEntryUpdated should be update to set the selectionIndex equal to null.

  _onTextEntryUpdated: function() {
    var value = this.refs.entry.value;
    this.setState({visible: this.getOptionsForValue(value, this.props.options),
                   selection: '',
                   selectionIndex: null,
                   entryValue: value});
  }