react-onclickoutside
Advanced tools
Comparing version 0.3.0 to 0.3.1
18
index.js
@@ -38,2 +38,18 @@ /** | ||
var isSourceFound = function(source, localNode) { | ||
if (source === localNode) { | ||
return true; | ||
} | ||
// SVG <use/> elements do not technically reside in the rendered DOM, so | ||
// they do not have classList directly, but they offer a link to their | ||
// corresponding element, which can have classList. This extra check is for | ||
// that case. | ||
// See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement | ||
// Discussion: https://github.com/Pomax/react-onclickoutside/pull/17 | ||
if (source.correspondingElement) { | ||
return source.correspondingElement.classList.contains(IGNORE_CLASS); | ||
} | ||
return source.classList.contains(IGNORE_CLASS); | ||
}; | ||
return { | ||
@@ -54,3 +70,3 @@ componentDidMount: function() { | ||
while(source.parentNode) { | ||
found = (source === localNode || source.classList.contains(IGNORE_CLASS)); | ||
found = isSourceFound(source, localNode); | ||
if(found) return; | ||
@@ -57,0 +73,0 @@ source = source.parentNode; |
{ | ||
"name": "react-onclickoutside", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "An onClickOutside mixin for React components", | ||
@@ -5,0 +5,0 @@ "main": "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
8459
140