diff --git a/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx b/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx index a93d6e688..d039ae10e 100644 --- a/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx @@ -4,6 +4,7 @@ import { Input } from 'antd'; import React from 'react'; import { RemoteSelect, RemoteSelectProps } from '../remote-select'; import useServiceOptions from './hooks'; +import { RecordProvider } from '../../../'; export type AssociationSelectProps

= RemoteSelectProps

& { action?: string; @@ -30,14 +31,16 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => { > {isAllowAddNew && ( - { - return s['x-component'] === 'Action'; - }} - /> + + { + return s['x-component'] === 'Action'; + }} + /> + )} diff --git a/packages/core/client/src/schema-component/antd/association-field/InternalPicker.tsx b/packages/core/client/src/schema-component/antd/association-field/InternalPicker.tsx index a93cf9904..409b4bb9f 100644 --- a/packages/core/client/src/schema-component/antd/association-field/InternalPicker.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/InternalPicker.tsx @@ -19,6 +19,7 @@ import { ActionContext } from '../action'; import { useAssociationFieldContext, useFieldNames, useInsertSchema } from './hooks'; import schema from './schema'; import { flatData, getLabelFormatValue, useLabelUiSchema } from './util'; +import { RecordProvider } from '../../../'; const useTableSelectorProps = () => { const field: any = useField(); @@ -159,14 +160,16 @@ export const InternalPicker = observer((props: any) => { /> {isAllowAddNew && ( - { - return s['x-component'] === 'Action'; - }} - /> + + { + return s['x-component'] === 'Action'; + }} + /> + )}