From 1b8e2d06d765ff68f0af1933b7bb0d94922710f9 Mon Sep 17 00:00:00 2001 From: Andrew Rasmussen Date: Mon, 19 Jan 2015 14:44:21 -0800 Subject: [PATCH] [fixed] ModalPortal's componentWillReceiveProps --- lib/components/ModalPortal.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index 78d846b4..ee820065 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -45,12 +45,10 @@ var ModalPortal = module.exports = React.createClass({ // Focus only needs to be set once when the modal is being opened if (!this.props.isOpen && newProps.isOpen) { this.setFocusAfterRender(true); - } - - if (newProps.isOpen === true) this.open(); - else if (newProps.isOpen === false) + } else if (this.props.isOpen && !newProps.isOpen) { this.close(); + } }, componentDidUpdate: function () {