Skip to content

Commit

Permalink
Allowing onInputChange to update input in Async component, as per Sel…
Browse files Browse the repository at this point in the history
…ect behaviour
  • Loading branch information
JedWatson committed Apr 29, 2016
1 parent f1e3e93 commit 894d822
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Async.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ const Async = React.createClass({
},
loadOptions (input) {
if (this.props.onInputChange) {
this.props.onInputChange(input);
let nextState = this.props.onInputChange(input);
// Note: != used deliberately here to catch undefined and null
if (nextState != null) {
input = '' + nextState;
}
}
if (this.props.ignoreAccents) input = stripDiacritics(input);
if (this.props.ignoreCase) input = input.toLowerCase();
Expand Down

0 comments on commit 894d822

Please sign in to comment.