diff --git a/packages/core/client/src/schema-component/antd/association-select/AssociationSelect.tsx b/packages/core/client/src/schema-component/antd/association-select/AssociationSelect.tsx index 11dfb50b09..16289fcc63 100644 --- a/packages/core/client/src/schema-component/antd/association-select/AssociationSelect.tsx +++ b/packages/core/client/src/schema-component/antd/association-select/AssociationSelect.tsx @@ -39,10 +39,7 @@ const InternalAssociationSelect = connect( (props: AssociationSelectProps) => { const { fieldNames, objectValue = true } = props; const service = useServiceOptions(props); - const field = useField(); - const fieldSchema = useFieldSchema(); - const { getField } = useCollection(); - const collectionField = getField(fieldSchema.name); + useFieldTitle(); const normalizeValues = useCallback( (obj) => { @@ -117,7 +114,6 @@ AssociationSelect.Designer = () => { const defaultSort = field.componentProps?.service?.params?.sort || []; const defaultFilter = field.componentProps?.service?.params?.filter || {}; const dataSource = useCollectionFilterOptions(collectionField?.target); - useFieldTitle(); const sort = defaultSort?.map((item: string) => { return item.startsWith('-') diff --git a/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx b/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx index 7c364a3448..b309c17442 100644 --- a/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx +++ b/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx @@ -35,7 +35,7 @@ const InternalRemoteSelect = connect( }, { debounceWait: wait, - refreshDeps: [service], + refreshDeps: [service, fieldNames.label, fieldNames.value], }, ); diff --git a/packages/core/client/src/schema-component/antd/select/Select.tsx b/packages/core/client/src/schema-component/antd/select/Select.tsx index 344680bd15..090f9a471f 100644 --- a/packages/core/client/src/schema-component/antd/select/Select.tsx +++ b/packages/core/client/src/schema-component/antd/select/Select.tsx @@ -56,7 +56,7 @@ const ObjectSelect = (props: Props) => { if (['tags', 'multiple'].includes(mode) || props.multiple) { onChange(current); } else { - onChange(current.shift()); + onChange(current.shift() || null); } }} mode={mode}