Comparing version 5.24.3 to 5.24.4
export default function contains(root, n) { | ||
if (!root) { | ||
return false; | ||
} // Use native if support | ||
if (root.contains) { | ||
return root.contains(n); | ||
} // `document.contains` not support with IE11 | ||
var node = n; | ||
while (node) { | ||
if (node === root) { | ||
return true; | ||
} | ||
node = node.parentNode; | ||
} | ||
return root.contains(n); | ||
return false; | ||
} |
import canUseDom from './canUseDom'; | ||
import contains from './contains'; | ||
var APPEND_ORDER = 'data-rc-order'; | ||
@@ -108,3 +109,3 @@ var MARK_KEY = "rc-util-key"; | ||
if (!cachedRealContainer || !document.contains(cachedRealContainer)) { | ||
if (!cachedRealContainer || !contains(document, cachedRealContainer)) { | ||
var placeholderStyle = injectCSS('', option); | ||
@@ -111,0 +112,0 @@ var parentNode = placeholderStyle.parentNode; |
@@ -11,5 +11,21 @@ "use strict"; | ||
return false; | ||
} // Use native if support | ||
if (root.contains) { | ||
return root.contains(n); | ||
} // `document.contains` not support with IE11 | ||
var node = n; | ||
while (node) { | ||
if (node === root) { | ||
return true; | ||
} | ||
node = node.parentNode; | ||
} | ||
return root.contains(n); | ||
return false; | ||
} |
@@ -14,2 +14,4 @@ "use strict"; | ||
var _contains = _interopRequireDefault(require("./contains")); | ||
var APPEND_ORDER = 'data-rc-order'; | ||
@@ -122,3 +124,3 @@ var MARK_KEY = "rc-util-key"; | ||
if (!cachedRealContainer || !document.contains(cachedRealContainer)) { | ||
if (!cachedRealContainer || !(0, _contains.default)(document, cachedRealContainer)) { | ||
var placeholderStyle = injectCSS('', option); | ||
@@ -125,0 +127,0 @@ var parentNode = placeholderStyle.parentNode; |
{ | ||
"name": "rc-util", | ||
"version": "5.24.3", | ||
"version": "5.24.4", | ||
"description": "Common Utils For React Component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
205478
6249