We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d5e76a commit 02cf2c3Copy full SHA for 02cf2c3
lib/components/ModalPortal.js
@@ -43,6 +43,10 @@ var ModalPortal = module.exports = React.createClass({
43
}
44
},
45
46
+ componentWillUnmount: function() {
47
+ clearTimeout(this.closeTimer);
48
+ },
49
+
50
componentWillReceiveProps: function(newProps) {
51
// Focus only needs to be set once when the modal is being opened
52
if (!this.props.isOpen && newProps.isOpen) {
@@ -87,7 +91,7 @@ var ModalPortal = module.exports = React.createClass({
87
91
88
92
closeWithTimeout: function() {
89
93
this.setState({beforeClose: true}, function() {
90
- setTimeout(this.closeWithoutTimeout, this.props.closeTimeoutMS);
94
+ this.closeTimer = setTimeout(this.closeWithoutTimeout, this.props.closeTimeoutMS);
95
}.bind(this));
96
97
0 commit comments