Skip to content

Commit 1b8e2d0

Browse files
author
Andrew Rasmussen
committed
[fixed] ModalPortal's componentWillReceiveProps
1 parent 6fd8456 commit 1b8e2d0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/components/ModalPortal.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ var ModalPortal = module.exports = React.createClass({
4545
// Focus only needs to be set once when the modal is being opened
4646
if (!this.props.isOpen && newProps.isOpen) {
4747
this.setFocusAfterRender(true);
48-
}
49-
50-
if (newProps.isOpen === true)
5148
this.open();
52-
else if (newProps.isOpen === false)
49+
} else if (this.props.isOpen && !newProps.isOpen) {
5350
this.close();
51+
}
5452
},
5553

5654
componentDidUpdate: function () {

0 commit comments

Comments
 (0)