Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JedWatson/react-select
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson committed Nov 24, 2017
2 parents 99a8fbc + a5cb3c3 commit 55ef43b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/src/components/States.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var StatesField = createClass({
value={this.state.selectValue}
onChange={this.updateValue}
rtl={this.state.rtl}
openOnClick={false}
searchable={this.state.searchable}
/>
<button style={{ marginTop: '15px' }} type="button" onClick={this.focusStateSelect}>Focus Select</button>
Expand Down
8 changes: 6 additions & 2 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,17 @@ class Select extends React.Component {
}
// If the menu isn't open, let the event bubble to the main handleMouseDown
if (!this.state.isOpen) {
return;
this.setState({
isOpen: true,
});
}
// prevent default event handlers
event.stopPropagation();
event.preventDefault();
// close the menu
this.closeMenu();
if(this.state.isOpen){
this.closeMenu();
}
}

handleMouseDownOnMenu (event) {
Expand Down

0 comments on commit 55ef43b

Please sign in to comment.