Merge branch 'main' into next

This commit is contained in:
GitHub Actions Bot 2024-07-25 02:50:03 +00:00
commit 09e3cb4996
3 changed files with 3 additions and 1 deletions

View File

@ -10,8 +10,8 @@
import { merge } from '@formily/shared';
import React from 'react';
import { useCurrentSchema } from '../utils';
import { SchemaInitializerSwitch, useSchemaInitializer } from '../../application';
import { useCurrentSchema } from '../utils';
export const InitializerWithSwitch = (props) => {
const { type, schema, item, remove: passInRemove, disabled } = props;

View File

@ -763,6 +763,7 @@ export const useCurrentSchema = (action: string, key: string, find = findSchema,
form?.query(new RegExp(`${schema.parent.name}.${schema.name}$`)).forEach((field: Field) => {
// 如果字段被删掉,那么在提交的时候不应该提交这个字段
field.setValue?.(undefined);
field.setInitialValue?.(undefined);
});
schema && rm(schema, remove);
},

View File

@ -495,6 +495,7 @@ export const SchemaSettingsRemove: FC<SchemaSettingsRemoveProps> = (props) => {
form?.query(new RegExp(`${fieldSchema.parent.name}.${fieldSchema.name}$`)).forEach((field: Field) => {
// 如果字段被删掉,那么在提交的时候不应该提交这个字段
field.setValue?.(undefined);
field.setInitialValue?.(undefined);
});
removeDataBlock(fieldSchema['x-uid']);
},