diff --git a/packages/core/client/src/block-provider/TableSelectorProvider.tsx b/packages/core/client/src/block-provider/TableSelectorProvider.tsx index ac11ea657..4b75dac2b 100644 --- a/packages/core/client/src/block-provider/TableSelectorProvider.tsx +++ b/packages/core/client/src/block-provider/TableSelectorProvider.tsx @@ -84,8 +84,8 @@ export const recursiveParent = (schema: Schema, component) => { return schema['x-component'] === component ? schema : schema.parent - ? recursiveParent(schema.parent, component) - : null; + ? recursiveParent(schema.parent, component) + : null; }; const useAssociationNames = (collection) => { @@ -256,6 +256,7 @@ export const useTableSelectorProps = () => { useEffect(() => { if (!ctx?.service?.loading) { field.value = ctx?.service?.data?.data; + field?.setInitialValue?.(ctx?.service?.data?.data); field.data = field.data || {}; field.data.selectedRowKeys = ctx?.field?.data?.selectedRowKeys; field.componentProps.pagination = field.componentProps.pagination || {}; diff --git a/packages/core/client/src/collection-manager/CollectionField.tsx b/packages/core/client/src/collection-manager/CollectionField.tsx index d3ee57d06..cb91c07ec 100644 --- a/packages/core/client/src/collection-manager/CollectionField.tsx +++ b/packages/core/client/src/collection-manager/CollectionField.tsx @@ -49,7 +49,6 @@ const InternalField: React.FC = (props: Props) => { const defaultVal = fieldSchema.default || defaultValue; defaultVal !== null && defaultVal !== undefined && setFieldProps('initialValue', defaultVal); } - if (!field.validator && (uiSchema['x-validator'] || fieldSchema['x-validator'])) { const concatSchema = concat([], uiSchema['x-validator'] || [], fieldSchema['x-validator'] || []); field.validator = concatSchema;