mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:36:42 +00:00
feat(client): allow search by title in collection select (#1869)
This commit is contained in:
parent
29956150ba
commit
0eb1c31514
@ -35,7 +35,7 @@ export const expression: ICollectionTemplate = {
|
||||
title: '{{t("Collection")}}',
|
||||
'x-component': 'CollectionSelect',
|
||||
'x-component-props': {
|
||||
multiple: true,
|
||||
// multiple: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -28,7 +28,15 @@ export const CollectionSelect = connect(
|
||||
const options = useOptions(props);
|
||||
const { t } = useTranslation();
|
||||
|
||||
return <Select placeholder={t('Select collection')} {...others} options={options} />;
|
||||
return (
|
||||
<Select
|
||||
placeholder={t('Select collection')}
|
||||
{...others}
|
||||
showSearch
|
||||
filterOption={(input, option) => (option?.label ?? '').includes(input)}
|
||||
options={options}
|
||||
/>
|
||||
);
|
||||
},
|
||||
mapReadPretty(
|
||||
observer((props: CollectionSelectProps) => {
|
||||
|
@ -7,12 +7,11 @@ export const collection = {
|
||||
type: 'string',
|
||||
title: '{{t("Collection")}}',
|
||||
required: true,
|
||||
'x-reactions': ['{{useCollectionDataSource()}}'],
|
||||
'x-reactions': [],
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Select',
|
||||
'x-component': 'CollectionSelect',
|
||||
'x-component-props': {
|
||||
dropdownMatchSelectWidth: false,
|
||||
placeholder: '{{t("Select collection")}}',
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user