ronds-metadata 1.2.49 → 1.2.51

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,7 +37,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
37
37
  /*
38
38
  * @Author:wangxian
39
39
  * @Date: 2021-09-18 14:15:04
40
- * @LastEditTime: 2023-05-17 15:50:09
40
+ * @LastEditTime: 2023-05-18 10:18:36
41
41
  */
42
42
  import React from 'react';
43
43
  import { MetadataFormContext, MetadataRefContext } from '../interface';
@@ -101,7 +101,7 @@ function Index(props) {
101
101
  });
102
102
  };
103
103
  useObservable(function (p) {
104
- var _extraInfo$http, _extraInfo$http2, _p$payload3;
104
+ var _extraInfo$http, _extraInfo$http2;
105
105
  // 判断是否有 watch的扩展属性
106
106
  var _watch = extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$http = extraInfo.http) === null || _extraInfo$http === void 0 ? void 0 : _extraInfo$http.watch;
107
107
  if (name && _watch && (p === null || p === void 0 ? void 0 : p.type) === 'onValuesChange') {
@@ -167,7 +167,7 @@ function Index(props) {
167
167
  console.warn('watch:' + error);
168
168
  }
169
169
  }
170
- if (treeData.length > 0 && name && (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$http2 = extraInfo.http) === null || _extraInfo$http2 === void 0 ? void 0 : _extraInfo$http2.isTreeSelect) && (p === null || p === void 0 ? void 0 : (_p$payload3 = p.payload) === null || _p$payload3 === void 0 ? void 0 : _p$payload3.trigger) === 'firstLoad' && (p === null || p === void 0 ? void 0 : p.type) === 'onValuesChange') {
170
+ if (treeData.length > 0 && name && (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$http2 = extraInfo.http) === null || _extraInfo$http2 === void 0 ? void 0 : _extraInfo$http2.isTreeSelect) && (p === null || p === void 0 ? void 0 : p.type) === 'onValuesChange') {
171
171
  var _evalString = '';
172
172
  for (var _i3 = 0; _i3 < name.length; _i3++) {
173
173
  _evalString = "".concat(_evalString, "[name[").concat(_i3, "]]");
@@ -381,16 +381,15 @@ function Index(props) {
381
381
  };
382
382
  var onDropdownVisibleChange = function onDropdownVisibleChange(_open) {
383
383
  setTreeselectOpen(_open);
384
- if (_open) {
384
+ if (_open && expandedKeys.length > 0 && treeRef.current) {
385
385
  setTimeout(function () {
386
- var _treeRef$current;
387
- (_treeRef$current = treeRef.current) === null || _treeRef$current === void 0 ? void 0 : _treeRef$current.scrollTo({
386
+ treeRef.current.scrollTo({
388
387
  key: expandedKeys[0],
389
388
  align: 'top',
390
389
  offset: 40
391
390
  });
392
391
  firstLoadTreeSelectRef.current = false;
393
- }, 100);
392
+ }, 200);
394
393
  }
395
394
  };
396
395
  var processSelectType = function processSelectType(isCascader, isTreeSelect, isPagination) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.2.49",
4
+ "version": "1.2.51",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",