@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.
@@ -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(_ref) {
13
- var target = _ref.target;
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
  };
@@ -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(_ref) {
20
- var target = _ref.target;
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"