Skip to content

Commit

Permalink
fixed exception when clearing an Async field that is not set to multi
Browse files Browse the repository at this point in the history
  • Loading branch information
VanCoding committed Jan 27, 2017
1 parent ef3a468 commit 4179217
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 4179217

Please sign in to comment.