fix: dropdownMatchSelectWidth: false

This commit is contained in:
chenos 2023-05-12 14:33:20 +08:00
parent 81b3afb57b
commit 901c05bc35
2 changed files with 5 additions and 2 deletions

View File

@ -1,8 +1,8 @@
import { LoadingOutlined } from '@ant-design/icons'; import { LoadingOutlined } from '@ant-design/icons';
import { connect, mapProps, mapReadPretty, useFieldSchema, useField } from '@formily/react'; import { connect, mapProps, mapReadPretty, useField, useFieldSchema } from '@formily/react';
import { SelectProps, Tag } from 'antd'; import { SelectProps, Tag } from 'antd';
import moment from 'moment';
import { uniqBy } from 'lodash'; import { uniqBy } from 'lodash';
import moment from 'moment';
import React, { useCallback, useEffect, useMemo, useRef } from 'react'; import React, { useCallback, useEffect, useMemo, useRef } from 'react';
import { ResourceActionOptions, useRequest } from '../../../api-client'; import { ResourceActionOptions, useRequest } from '../../../api-client';
import { mergeFilter } from '../../../block-provider/SharedFilterProvider'; import { mergeFilter } from '../../../block-provider/SharedFilterProvider';
@ -191,6 +191,7 @@ const InternalRemoteSelect = connect(
return ( return (
<Select <Select
dropdownMatchSelectWidth={false}
autoClearSearchValue autoClearSearchValue
filterOption={false} filterOption={false}
filterSort={null} filterSort={null}

View File

@ -41,6 +41,7 @@ const ObjectSelect = (props: Props) => {
options={options} options={options}
fieldNames={fieldNames} fieldNames={fieldNames}
showSearch showSearch
dropdownMatchSelectWidth={false}
filterOption={(input, option) => (option?.[fieldNames.label || 'label'] ?? '').includes(input)} filterOption={(input, option) => (option?.[fieldNames.label || 'label'] ?? '').includes(input)}
filterSort={(optionA, optionB) => filterSort={(optionA, optionB) =>
(optionA?.[fieldNames.label || 'label'] ?? '') (optionA?.[fieldNames.label || 'label'] ?? '')
@ -82,6 +83,7 @@ const InternalSelect = connect(
showSearch showSearch
filterOption={filterOption} filterOption={filterOption}
allowClear allowClear
dropdownMatchSelectWidth={false}
value={value} value={value}
{...others} {...others}
onChange={(changed) => { onChange={(changed) => {