@sheinx/hooks 3.1.27 → 3.1.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAI7C,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;AACnD,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAAE,MAAM,EAAE;IAE5D,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAE9B,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAC/B,QAkCA;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAI7C,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;AACnD,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAAE,MAAM,EAAE;IAE5D,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAE9B,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAC/B,QAqCA;AAED,eAAe,YAAY,CAAC"}
@@ -45,7 +45,10 @@ function useClickAway(params) {
45
45
  }
46
46
  return function () {
47
47
  // @ts-ignore
48
- document.removeEventListener(event, handleClickAway);
48
+ document.removeEventListener(event, handleClickAway, {
49
+ // 解决 点击后立刻删除dom导致获取不到元素; contains(target) 为 false 的问题
50
+ capture: true
51
+ });
49
52
  };
50
53
  }, [effect]);
51
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAI7C,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;AACnD,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAAE,MAAM,EAAE;IAE5D,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAE9B,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAC/B,QAkCA;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAI7C,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;AACnD,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAAE,MAAM,EAAE;IAE5D,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAE9B,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAC/B,QAqCA;AAED,eAAe,YAAY,CAAC"}
@@ -37,7 +37,10 @@ export function useClickAway(params) {
37
37
  }
38
38
  return function () {
39
39
  // @ts-ignore
40
- document.removeEventListener(event, handleClickAway);
40
+ document.removeEventListener(event, handleClickAway, {
41
+ // 解决 点击后立刻删除dom导致获取不到元素; contains(target) 为 false 的问题
42
+ capture: true
43
+ });
41
44
  };
42
45
  }, [effect]);
43
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.1.27",
3
+ "version": "3.1.28",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",