fmoo / react-typeahead

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

On re-select the input-text the first option in list becomes selected by default. #189

Closed nitin-daffodil closed 8 years ago

nitin-daffodil 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});
  }