Skip to content

Commit

Permalink
Merge pull request #4328 from Sekhmet/fix-dropdownmenu-callback
Browse files Browse the repository at this point in the history
[DropDownMenu] Add check if there is onChange prop before calling it.
  • Loading branch information
mbrookes committed May 25, 2016
2 parents 5af6936 + dcbb096 commit 66565b9
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 66565b9

Please sign in to comment.