react-portal-popover
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -63,4 +63,10 @@ 'use strict'; | ||
}, { | ||
key: 'componentDidUpdate', | ||
value: function componentDidUpdate() { | ||
this.isNodeMounted = true; | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
this.isNodeMounted = false; | ||
this.removeCloseHandler(); | ||
@@ -88,8 +94,9 @@ } | ||
this.removeCloseHandler(); | ||
// Prevent race with toggleOverlay | ||
setTimeout(function () { | ||
_this3.setState({ | ||
open: false | ||
}); | ||
if (_this3.isNodeMounted) { | ||
_this3.setState({ | ||
open: false | ||
}); | ||
_this3.removeCloseHandler(); | ||
} | ||
}, 0); | ||
@@ -96,0 +103,0 @@ } |
{ | ||
"name": "react-portal-popover", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Popover for React using portals", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -35,3 +35,8 @@ import React from 'react'; | ||
componentDidUpdate() { | ||
this.isNodeMounted = true; | ||
} | ||
componentWillUnmount() { | ||
this.isNodeMounted = false; | ||
this.removeCloseHandler(); | ||
@@ -53,8 +58,9 @@ } | ||
onClose() { | ||
this.removeCloseHandler(); | ||
// Prevent race with toggleOverlay | ||
setTimeout(() => { | ||
this.setState({ | ||
open: false, | ||
}); | ||
if (this.isNodeMounted) { | ||
this.setState({ | ||
open: false, | ||
}); | ||
this.removeCloseHandler(); | ||
} | ||
}, 0); | ||
@@ -61,0 +67,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59435
1374