fix: auto expand the fields group
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user