fix: auto expand the fields group

This commit is contained in:
jialin
2025-11-07 11:56:12 +08:00
parent 39efca0d4c
commit 64e2cfa35a
18 changed files with 168 additions and 101 deletions
+9 -1
View File
@@ -2,9 +2,11 @@ import IconFont from '@/components/icon-font';
import type { SelectProps } from 'antd';
import { Select } from 'antd';
import React, { forwardRef, useImperativeHandle } from 'react';
import NotFoundContent from '../components/not-found-content';
const BaseSelect: React.FC<SelectProps & { ref?: any }> = forwardRef(
(props, ref) => {
const { notFoundContent, loading, ...restProps } = props;
const [isFocus, setIsFocus] = React.useState(false);
const inputRef = React.useRef<any>(null);
@@ -32,7 +34,13 @@ const BaseSelect: React.FC<SelectProps & { ref?: any }> = forwardRef(
return (
<Select
{...props}
{...restProps}
notFoundContent={
<NotFoundContent
loading={loading}
notFoundContent={notFoundContent}
/>
}
ref={inputRef}
onFocus={handleFocus}
onBlur={handleBlur}
@@ -34,7 +34,10 @@ const NotFoundContent: React.FC<{
return (
<NoContent>
{notFoundContent || (
<Empty description={intl.formatMessage({ id: 'common.data.empty' })} />
<Empty
description={intl.formatMessage({ id: 'common.data.empty' })}
image={Empty.PRESENTED_IMAGE_SIMPLE}
/>
)}
</NoContent>
);