Skip to content

Commit

Permalink
Merge pull request JedWatson#1508 from VanCoding/onchange-fix
Browse files Browse the repository at this point in the history
fixed exception when clearing an Async field that is not set to multi
  • Loading branch information
JedWatson authored Jan 31, 2017
2 parents ef3a468 + 4179217 commit d1feb1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Async.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default class Async extends Component {
options: (isLoading && loadingPlaceholder) ? [] : options,
ref: (ref) => (this.select = ref),
onChange: (newValues) => {
if (this.props.value && (newValues.length > this.props.value.length)) {
if (this.props.multi && this.props.value && (newValues.length > this.props.value.length)) {
this.clearOptions();
}
this.props.onChange(newValues);
Expand Down

0 comments on commit d1feb1d

Please sign in to comment.