Skip to content

Commit

Permalink
[IconMenu] Set container as anchorEl when using prop 'open'
Browse files Browse the repository at this point in the history
  • Loading branch information
crashbell committed Mar 11, 2016
1 parent d768a13 commit c12e754
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/menus/icon-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ const IconMenu = React.createClass({
muiTheme: nextContext.muiTheme || this.state.muiTheme,
});

if (nextProps.open === true || nextProps.open === false) {
this.setState({open: nextProps.open});
if (nextProps.open !== null) {
this.setState({
open: nextProps.open,
anchorEl: ReactDOM.findDOMNode(this.refs.iconMenuContainer),
});
}
},

Expand Down Expand Up @@ -315,6 +318,7 @@ const IconMenu = React.createClass({

return (
<div
ref="iconMenuContainer"
className={className}
onMouseDown={onMouseDown}
onMouseLeave={onMouseLeave}
Expand Down

0 comments on commit c12e754

Please sign in to comment.