@hi-ui/check-select 4.1.2 → 4.1.3

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @hi-ui/check-select
2
2
 
3
+ ## 4.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2482](https://github.com/XiaoMi/hiui/pull/2482) [`3301a290f`](https://github.com/XiaoMi/hiui/commit/3301a290fa9bd8b8717e24ef69ed832aa392b11e) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 数据改变后显示一次滚动条
8
+
9
+ - Updated dependencies [[`6980d058f`](https://github.com/XiaoMi/hiui/commit/6980d058f165b309695d10248d7511bd05bee457)]:
10
+ - @hi-ui/input@4.0.9
11
+
3
12
  ## 4.1.2
4
13
 
5
14
  ### Patch Changes
@@ -298,13 +298,13 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
298
298
  var cls = classname.cx(prefixCls, className, prefixCls + "--" + (menuVisible ? 'open' : 'closed'));
299
299
  var listRef = React.useRef(null);
300
300
  React.useEffect(function () {
301
- var _a; // 每次打开时触发一次滚动条显示
301
+ var _a; // 每次打开或数据改变时触发一次滚动条显示
302
302
 
303
303
 
304
- if (menuVisible) {
304
+ if (menuVisible && typeAssertion.isArrayNonEmpty(showData)) {
305
305
  (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(undefined);
306
306
  }
307
- }, [menuVisible]);
307
+ }, [menuVisible, showData]);
308
308
  return /*#__PURE__*/React__default["default"].createElement(context.CheckSelectProvider, {
309
309
  value: context$1
310
310
  }, /*#__PURE__*/React__default["default"].createElement(picker.Picker, Object.assign({
@@ -256,13 +256,13 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
256
256
  var cls = cx(prefixCls, className, prefixCls + "--" + (menuVisible ? 'open' : 'closed'));
257
257
  var listRef = useRef(null);
258
258
  useEffect(function () {
259
- var _a; // 每次打开时触发一次滚动条显示
259
+ var _a; // 每次打开或数据改变时触发一次滚动条显示
260
260
 
261
261
 
262
- if (menuVisible) {
262
+ if (menuVisible && isArrayNonEmpty(showData)) {
263
263
  (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(undefined);
264
264
  }
265
- }, [menuVisible]);
265
+ }, [menuVisible, showData]);
266
266
  return /*#__PURE__*/React.createElement(CheckSelectProvider, {
267
267
  value: context
268
268
  }, /*#__PURE__*/React.createElement(Picker, Object.assign({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/check-select",
3
- "version": "4.1.2",
3
+ "version": "4.1.3",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",
@@ -50,7 +50,7 @@
50
50
  "@hi-ui/func-utils": "^4.0.1",
51
51
  "@hi-ui/highlighter": "^4.0.5",
52
52
  "@hi-ui/icons": "^4.0.6",
53
- "@hi-ui/input": "^4.0.6",
53
+ "@hi-ui/input": "^4.0.9",
54
54
  "@hi-ui/picker": "^4.0.6",
55
55
  "@hi-ui/popper": "^4.0.4",
56
56
  "@hi-ui/tag-input": "^4.0.5",