react-dropdown
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -26,2 +26,3 @@ "use strict"; | ||
}; | ||
this.mounted = true; | ||
} | ||
@@ -46,2 +47,3 @@ | ||
value: function componentWillUnmount() { | ||
this.mounted = false; | ||
document.removeEventListener("click", this.handleDocumentClick.bind(this), false); | ||
@@ -129,4 +131,6 @@ } | ||
value: function handleDocumentClick(event) { | ||
if (!React.findDOMNode(this).contains(event.target)) { | ||
this.setState({ isOpen: false }); | ||
if (this.mounted) { | ||
if (!React.findDOMNode(this).contains(event.target)) { | ||
this.setState({ isOpen: false }); | ||
} | ||
} | ||
@@ -133,0 +137,0 @@ } |
@@ -16,2 +16,3 @@ 'use strict'; | ||
} | ||
this.mounted = true; | ||
} | ||
@@ -30,2 +31,3 @@ | ||
componentWillUnmount() { | ||
this.mounted = false; | ||
document.removeEventListener("click", this.handleDocumentClick.bind(this), false); | ||
@@ -90,4 +92,6 @@ } | ||
handleDocumentClick(event) { | ||
if (!React.findDOMNode(this).contains(event.target)) { | ||
this.setState({isOpen:false}); | ||
if(this.mounted) { | ||
if (!React.findDOMNode(this).contains(event.target)) { | ||
this.setState({isOpen:false}); | ||
} | ||
} | ||
@@ -94,0 +98,0 @@ } |
{ | ||
"name": "react-dropdown", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "React dropdown component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20845
552
0