react-relative-portal
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -29,4 +29,15 @@ 'use strict'; | ||
function getRID(node) { | ||
return node && node.dataset && node.dataset.reactid || ''; | ||
function isDescendant(parent, child) { | ||
if (parent.isEqualNode(child)) { | ||
return true; | ||
} | ||
var node = child.parentNode; | ||
while (node !== null) { | ||
if (node.isEqualNode(parent)) { | ||
return true; | ||
} | ||
node = node.parentNode; | ||
} | ||
return false; | ||
} | ||
@@ -47,5 +58,3 @@ | ||
_this.handleOutClick = function (e) { | ||
var rid = getRID(_reactDom2.default.findDOMNode(_this.element)); | ||
var eRid = getRID(e.target); | ||
if (eRid.indexOf(rid) !== 0 && _this.props.onOutClick) { | ||
if (!isDescendant(_reactDom2.default.findDOMNode(_this.element), e.target)) { | ||
_this.props.onOutClick(); | ||
@@ -52,0 +61,0 @@ } |
{ | ||
"name": "react-relative-portal", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "React component for place dropdowns outside overflow: hidden; elements", | ||
@@ -51,5 +51,5 @@ "main": "dist/RelativePortal.js", | ||
"peerDependencies": { | ||
"react": "^0.14.2", | ||
"react-dom": "^0.14.2" | ||
"react": ">=0.14.0", | ||
"react-dom": ">=0.14.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
14227
214