@hi-ui/check-select 4.1.1 → 4.1.2
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/CHANGELOG.md +9 -0
- package/lib/cjs/CheckSelect.js +10 -0
- package/lib/esm/CheckSelect.js +11 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# @hi-ui/check-select
|
2
2
|
|
3
|
+
## 4.1.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#2411](https://github.com/XiaoMi/hiui/pull/2411) [`f7d1257ad`](https://github.com/XiaoMi/hiui/commit/f7d1257ad2006fd40cabb2d16f1fde77677f3117) Thanks [@zyprepare](https://github.com/zyprepare)! - 体验优化: 大数据列表中,打开下拉列表时有一次滚动条提示
|
8
|
+
|
9
|
+
- Updated dependencies [[`f7d1257ad`](https://github.com/XiaoMi/hiui/commit/f7d1257ad2006fd40cabb2d16f1fde77677f3117)]:
|
10
|
+
- @hi-ui/icons@4.0.6
|
11
|
+
|
3
12
|
## 4.1.1
|
4
13
|
|
5
14
|
### Patch Changes
|
package/lib/cjs/CheckSelect.js
CHANGED
@@ -296,6 +296,15 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
296
296
|
inVirtual = _useCheckInVirtual.inVirtual;
|
297
297
|
|
298
298
|
var cls = classname.cx(prefixCls, className, prefixCls + "--" + (menuVisible ? 'open' : 'closed'));
|
299
|
+
var listRef = React.useRef(null);
|
300
|
+
React.useEffect(function () {
|
301
|
+
var _a; // 每次打开时触发一次滚动条显示
|
302
|
+
|
303
|
+
|
304
|
+
if (menuVisible) {
|
305
|
+
(_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(undefined);
|
306
|
+
}
|
307
|
+
}, [menuVisible]);
|
299
308
|
return /*#__PURE__*/React__default["default"].createElement(context.CheckSelectProvider, {
|
300
309
|
value: context$1
|
301
310
|
}, /*#__PURE__*/React__default["default"].createElement(picker.Picker, Object.assign({
|
@@ -370,6 +379,7 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
370
379
|
}
|
371
380
|
})
|
372
381
|
}), typeAssertion.isArrayNonEmpty(dropdownItems) ? /*#__PURE__*/React__default["default"].createElement(VirtualList__default["default"], Object.assign({
|
382
|
+
ref: listRef,
|
373
383
|
itemKey: "id",
|
374
384
|
fullHeight: false
|
375
385
|
}, virtualListProps), function (node) {
|
package/lib/esm/CheckSelect.js
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
import { __rest } from 'tslib';
|
11
|
-
import React, { forwardRef, useCallback, useMemo, useState, useRef } from 'react';
|
11
|
+
import React, { forwardRef, useCallback, useMemo, useState, useRef, useEffect } from 'react';
|
12
12
|
import { getPrefixCls, cx } from '@hi-ui/classname';
|
13
13
|
import { __DEV__ } from '@hi-ui/env';
|
14
14
|
import { useCheckSelect } from './use-check-select.js';
|
@@ -254,6 +254,15 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
254
254
|
inVirtual = _useCheckInVirtual.inVirtual;
|
255
255
|
|
256
256
|
var cls = cx(prefixCls, className, prefixCls + "--" + (menuVisible ? 'open' : 'closed'));
|
257
|
+
var listRef = useRef(null);
|
258
|
+
useEffect(function () {
|
259
|
+
var _a; // 每次打开时触发一次滚动条显示
|
260
|
+
|
261
|
+
|
262
|
+
if (menuVisible) {
|
263
|
+
(_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(undefined);
|
264
|
+
}
|
265
|
+
}, [menuVisible]);
|
257
266
|
return /*#__PURE__*/React.createElement(CheckSelectProvider, {
|
258
267
|
value: context
|
259
268
|
}, /*#__PURE__*/React.createElement(Picker, Object.assign({
|
@@ -328,6 +337,7 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
328
337
|
}
|
329
338
|
})
|
330
339
|
}), isArrayNonEmpty(dropdownItems) ? /*#__PURE__*/React.createElement(VirtualList, Object.assign({
|
340
|
+
ref: listRef,
|
331
341
|
itemKey: "id",
|
332
342
|
fullHeight: false
|
333
343
|
}, virtualListProps), function (node) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hi-ui/check-select",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.2",
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
5
5
|
"keywords": [],
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
@@ -49,7 +49,7 @@
|
|
49
49
|
"@hi-ui/env": "^4.0.1",
|
50
50
|
"@hi-ui/func-utils": "^4.0.1",
|
51
51
|
"@hi-ui/highlighter": "^4.0.5",
|
52
|
-
"@hi-ui/icons": "^4.0.
|
52
|
+
"@hi-ui/icons": "^4.0.6",
|
53
53
|
"@hi-ui/input": "^4.0.6",
|
54
54
|
"@hi-ui/picker": "^4.0.6",
|
55
55
|
"@hi-ui/popper": "^4.0.4",
|