@rc-component/trigger 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/hooks/useWinClick.js
CHANGED
|
@@ -9,9 +9,9 @@ export default function useWinClick(open, clickToHide, targetEle, popupEle, mask
|
|
|
9
9
|
// Click to hide is special action since click popup element should not hide
|
|
10
10
|
React.useEffect(function () {
|
|
11
11
|
if (clickToHide && popupEle && (!mask || maskClosable)) {
|
|
12
|
-
var onTriggerClose = function onTriggerClose(
|
|
13
|
-
var
|
|
14
|
-
if (openRef.current && !inPopupOrChild(target)) {
|
|
12
|
+
var onTriggerClose = function onTriggerClose(e) {
|
|
13
|
+
var _e$composedPath;
|
|
14
|
+
if (openRef.current && !inPopupOrChild(((_e$composedPath = e.composedPath) === null || _e$composedPath === void 0 || (_e$composedPath = _e$composedPath.call(e)) === null || _e$composedPath === void 0 ? void 0 : _e$composedPath[0]) || e.target)) {
|
|
15
15
|
triggerOpen(false);
|
|
16
16
|
}
|
|
17
17
|
};
|
package/lib/hooks/useWinClick.js
CHANGED
|
@@ -16,9 +16,9 @@ function useWinClick(open, clickToHide, targetEle, popupEle, mask, maskClosable,
|
|
|
16
16
|
// Click to hide is special action since click popup element should not hide
|
|
17
17
|
React.useEffect(function () {
|
|
18
18
|
if (clickToHide && popupEle && (!mask || maskClosable)) {
|
|
19
|
-
var onTriggerClose = function onTriggerClose(
|
|
20
|
-
var
|
|
21
|
-
if (openRef.current && !inPopupOrChild(target)) {
|
|
19
|
+
var onTriggerClose = function onTriggerClose(e) {
|
|
20
|
+
var _e$composedPath;
|
|
21
|
+
if (openRef.current && !inPopupOrChild(((_e$composedPath = e.composedPath) === null || _e$composedPath === void 0 || (_e$composedPath = _e$composedPath.call(e)) === null || _e$composedPath === void 0 ? void 0 : _e$composedPath[0]) || e.target)) {
|
|
22
22
|
triggerOpen(false);
|
|
23
23
|
}
|
|
24
24
|
};
|