Skip to content

Commit

Permalink
Merge 5870dde into 8de72b6
Browse files Browse the repository at this point in the history
  • Loading branch information
visusnet committed Jul 25, 2018
2 parents 8de72b6 + 5870dde commit dc8ba4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Typeahead.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,12 @@ export default class Typeahead extends PureComponent<Props, State> {
const {autoSelectSingleOption, options} = this.props;
if (autoSelectSingleOption && options.length === 1) {
const valueOfSingleOption = options[0].value;
this.setState({
highlightedIndex: 0,
value: valueOfSingleOption,
typedLabel: Typeahead._getLabelByValue(valueOfSingleOption, this.props.options,
this.props.allowUnknownValue)
});
this._fireOnChange(valueOfSingleOption);
}

Expand Down

0 comments on commit dc8ba4f

Please sign in to comment.