Skip to content
Open
10 changes: 6 additions & 4 deletions src/components/Picklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,12 @@ class Picklist extends Component {
}

handleFocus() {
const { onFocus, value } = this.props;
const eventValue = value || null;
onFocus(eventValue);
const { isOpen } = this.state;
if (!isOpen) {
const { onFocus, value } = this.props;
const eventValue = value || null;
onFocus(eventValue);
}
}

handleBlur() {
Expand All @@ -185,7 +188,6 @@ class Picklist extends Component {
const { label, name, icon, value } = option;
this.closeMenu();
setTimeout(() => {
this.focus();
return onChange({ label, name, icon, value });
}, 0);
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Picklist/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const initialState = { value: { name: 'option 3', label: 'Central Park' } };
onChange={value => setState({ value })}
value={state.value}
label="Select Building"
onClick={() => console.log('click')}
onFocus={() => console.log('focus')}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these console

hideLabel
>
<Option name="header" label="Your Buildings" variant="header" />
Expand Down