diff --git a/js/component/file-actions.js b/js/component/file-actions.js index 0eab19dea..583d094d1 100644 --- a/js/component/file-actions.js +++ b/js/component/file-actions.js @@ -252,9 +252,11 @@ export let FileActions = React.createClass({ }); }, onFileInfoUpdate: function(fileInfo) { - this.setState({ - fileInfo: fileInfo, - }); + if (this.isMounted) { + this.setState({ + fileInfo: fileInfo, + }); + } }, componentDidMount: function() { this._isMounted = true; diff --git a/js/component/menu.js b/js/component/menu.js index 2e4321e6d..c35952426 100644 --- a/js/component/menu.js +++ b/js/component/menu.js @@ -42,7 +42,7 @@ export let DropDownMenu = React.createClass({ window.removeEventListener('click', this.handleWindowClick, false); } }, - onMenuIconClick: function(e) { + handleMenuIconClick: function(e) { this.setState({ menuOpen: !this.state.menuOpen, }); @@ -53,6 +53,12 @@ export let DropDownMenu = React.createClass({ } return false; }, + handleMenuClick: function(e) { + // Event bubbles up to the menu after a link is clicked + this.setState({ + menuOpen: false, + }); + }, handleWindowClick: function(e) { if (this.state.menuOpen && (!this._menuDiv || !this._menuDiv.contains(e.target))) { @@ -68,9 +74,9 @@ export let DropDownMenu = React.createClass({ } return (
Did you find something wrong?
- +