@sheinx/hooks 3.7.7-beta.2 → 3.7.7-beta.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CAyIvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CA4IvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -97,7 +97,10 @@ var useInput = function useInput(params) {
97
97
  (_otherHandlers$onFocu = otherHandlers.onFocus) === null || _otherHandlers$onFocu === void 0 || _otherHandlers$onFocu.call(otherHandlers, event);
98
98
  setFocused(true);
99
99
  if (autoSelect) {
100
- event.target.select();
100
+ // why requestAnimationFrame: 当在文字身体上hover后立即点击,select()与浏览器的光标定位逻辑产生竞争,有可能导致只选中的部分文本,所以需要延迟一下
101
+ requestAnimationFrame(function () {
102
+ event.target.select();
103
+ });
101
104
  }
102
105
  };
103
106
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CAyIvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CA4IvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -88,7 +88,10 @@ var useInput = function useInput(params) {
88
88
  (_otherHandlers$onFocu = otherHandlers.onFocus) === null || _otherHandlers$onFocu === void 0 || _otherHandlers$onFocu.call(otherHandlers, event);
89
89
  setFocused(true);
90
90
  if (autoSelect) {
91
- event.target.select();
91
+ // why requestAnimationFrame: 当在文字身体上hover后立即点击,select()与浏览器的光标定位逻辑产生竞争,有可能导致只选中的部分文本,所以需要延迟一下
92
+ requestAnimationFrame(function () {
93
+ event.target.select();
94
+ });
92
95
  }
93
96
  };
94
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.7.7-beta.2",
3
+ "version": "3.7.7-beta.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",