Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Async.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const Async = React.createClass({
placeholder: stringOrNode, // field placeholder, displayed when there's no value (shared with Select)
searchPromptText: stringOrNode, // label to prompt for search input
searchingText: React.PropTypes.string, // message to display while options are loading
options: React.PropTypes.array, // initial options, usefull if you want to do a preselection and your minimumInput is > 0
},
getDefaultProps () {
return {
Expand Down Expand Up @@ -86,6 +87,14 @@ const Async = React.createClass({
cache: initCache(nextProps.cache),
});
}

if (nextProps.options !== this.props.options) {
if (nextProps.options && nextProps.options.length > 0) {
this.setState({
options: nextProps.options,
});
}
}
},
focus () {
this.select.focus();
Expand Down