Skip to content

Commit

Permalink
update comment on BasePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
aimane-chnaif committed Oct 18, 2022
1 parent 4b9978a commit 5029369
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Picker/BasePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class BasePicker extends React.Component {
super(props);

this.executeOnCloseAndOnBlur = this.executeOnCloseAndOnBlur.bind(this);
this.setDefaultValue = this.setDefaultValue.bind(this);
}

componentDidMount() {
Expand All @@ -26,7 +25,8 @@ class BasePicker extends React.Component {
}

setDefaultValue() {
// set default value only if number of items is one
// When there is only 1 element in the selector, we do the user a favor and automatically select it for them
// so they don't have to spend extra time selecting the only possible value.
if (this.props.value || !this.props.items || this.props.items.length !== 1 || !this.props.onInputChange) {
return;
}
Expand Down

0 comments on commit 5029369

Please sign in to comment.