From c240228a698f81d238e2fb9e987ecac204d79d9a Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Wed, 21 Jun 2023 16:00:39 +0800 Subject: [PATCH] fix: unable to load data from chinaRegion during the first configuation (#2089) Close T-607 --- .../client/src/schema-component/antd/cascader/Cascader.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/cascader/Cascader.tsx b/packages/core/client/src/schema-component/antd/cascader/Cascader.tsx index bd94c8d34..c6ec9cf5e 100644 --- a/packages/core/client/src/schema-component/antd/cascader/Cascader.tsx +++ b/packages/core/client/src/schema-component/antd/cascader/Cascader.tsx @@ -2,10 +2,9 @@ import { LoadingOutlined } from '@ant-design/icons'; import { ArrayField } from '@formily/core'; import { connect, mapProps, mapReadPretty, useField } from '@formily/react'; import { toArr } from '@formily/shared'; -import { action } from '@formily/reactive'; import { Cascader as AntdCascader, Space } from 'antd'; import { isBoolean, omit } from 'lodash'; -import React, { useState } from 'react'; +import React from 'react'; import { useRequest } from '../../../api-client'; import { defaultFieldNames } from './defaultFieldNames'; import { ReadPretty } from './ReadPretty'; @@ -64,7 +63,7 @@ export const Cascader = connect( ); }; const handelDropDownVisible = (value) => { - if (value && !field.dataSource) { + if (value && !field.dataSource.length) { run(); } };