react-relative-portal
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -29,17 +29,2 @@ 'use strict'; | ||
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; | ||
} | ||
var Portal = function (_React$Component) { | ||
@@ -59,5 +44,10 @@ _inherits(Portal, _React$Component); | ||
if (typeof _this.props.onOutClick === 'function') { | ||
if (!isDescendant(_reactDom2.default.findDOMNode(_this.element), e.target)) { | ||
_this.props.onOutClick(); | ||
} | ||
(function () { | ||
var root = _reactDom2.default.findDOMNode(_this.element); | ||
if (!e.path.some(function (node) { | ||
return node.isEqualNode && node.isEqualNode(root); | ||
})) { | ||
_this.props.onOutClick(); | ||
} | ||
})(); | ||
} | ||
@@ -64,0 +54,0 @@ }; |
{ | ||
"name": "react-relative-portal", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "React component for place dropdowns outside overflow: hidden; elements", | ||
@@ -5,0 +5,0 @@ "main": "dist/RelativePortal.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
14634
212