Skip to content

Commit

Permalink
Merge pull request #2062 from pinturic/patch-1
Browse files Browse the repository at this point in the history
[LeftNav] Fix resize when using children
  • Loading branch information
oliviertassinari committed Nov 5, 2015
2 parents 789eaee + 2019ad9 commit 7df3a99
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/left-nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,12 @@ const LeftNav = React.createClass({

_updateMenuHeight() {
if (this.props.header) {
let container = ReactDOM.findDOMNode(this.refs.clickAwayableElement);
let menu = ReactDOM.findDOMNode(this.refs.menuItems);
let menuHeight = container.clientHeight - menu.offsetTop;
menu.style.height = menuHeight + 'px';
const menu = ReactDOM.findDOMNode(this.refs.menuItems);
if (menu){
const container = ReactDOM.findDOMNode(this.refs.clickAwayableElement);
const menuHeight = container.clientHeight - menu.offsetTop;
menu.style.height = menuHeight + 'px';
}
}
},

Expand Down

0 comments on commit 7df3a99

Please sign in to comment.