Skip to content

Commit

Permalink
[DropDownMenu] Add check if there is onChange prop before calling it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sekhmet committed May 24, 2016
1 parent be15233 commit dcbb096
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DropDownMenu/DropDownMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,12 @@ class DropDownMenu extends Component {
};

handleItemTouchTap = (event, child, index) => {
this.props.onChange(event, index, child.props.value);

this.setState({
open: false,
}, () => {
if (this.props.onChange) {
this.props.onChange(event, index, child.props.value);
}
});
};

Expand Down

0 comments on commit dcbb096

Please sign in to comment.