Skip to content

Commit

Permalink
Merge pull request #3913 from jakeboone02/ref-key-props
Browse files Browse the repository at this point in the history
[IconMenu] Removed props.ref call
  • Loading branch information
nathanmarks committed Apr 11, 2016
2 parents 3efd6da + e9b5703 commit e1544fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/IconMenu/IconMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ class IconMenu extends React.Component {
};

state = {
iconButtonRef: this.props.iconButtonElement.props.ref || 'iconButton',
menuInitiallyKeyboardFocused: false,
open: false,
};
Expand Down Expand Up @@ -205,7 +204,7 @@ class IconMenu extends React.Component {
this.setState({open: false}, () => {
// Set focus on the icon button when the menu close
if (isKeyboard) {
const iconButton = this.refs[this.state.iconButtonRef];
const iconButton = this.refs.iconButton;
ReactDOM.findDOMNode(iconButton).focus();
iconButton.setKeyboardFocus();
}
Expand Down Expand Up @@ -293,7 +292,7 @@ class IconMenu extends React.Component {
this.open(Events.isKeyboard(event) ? 'keyboard' : 'iconTap', event);
if (iconButtonElement.props.onTouchTap) iconButtonElement.props.onTouchTap(event);
},
ref: this.state.iconButtonRef,
ref: 'iconButton',
});

const menu = (
Expand Down

0 comments on commit e1544fd

Please sign in to comment.