Skip to content

Commit

Permalink
[IconMenu] Fix controlled IconMenus to honor onRequestChange (#5704)
Browse files Browse the repository at this point in the history
  • Loading branch information
hai-cea authored and oliviertassinari committed Dec 2, 2016
1 parent 825ea44 commit 14441c8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/IconMenu/IconMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ class IconMenu extends Component {

if (this.props.open !== null) {
this.props.onRequestChange(false, reason);
} else {
this.setState({open: false}, () => {
// Set focus on the icon button when the menu close
if (isKeyboard) {
const iconButton = this.refs.iconButton;
ReactDOM.findDOMNode(iconButton).focus();
iconButton.setKeyboardFocus();
}
});
}

this.setState({open: false}, () => {
// Set focus on the icon button when the menu close
if (isKeyboard) {
const iconButton = this.refs.iconButton;
ReactDOM.findDOMNode(iconButton).focus();
iconButton.setKeyboardFocus();
}
});
}

open(reason, event) {
Expand Down

0 comments on commit 14441c8

Please sign in to comment.