mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:55:33 +00:00
fix: field in detail block should not allow config default value (#2858)
This commit is contained in:
parent
a4cccb4032
commit
e920629a91
@ -48,6 +48,7 @@ const useIsAllowToSetDefaultValue = ({ form, fieldSchema, collectionField }: Pro
|
||||
const { form: innerForm } = useFormBlockContext();
|
||||
const innerFieldSchema = useFieldSchema();
|
||||
const { type } = useFormBlockType();
|
||||
console.log(type);
|
||||
const { isAllowToSetDefaultValue = _isAllowToSetDefaultValue } = useContext(DefaultValueContext) || {};
|
||||
|
||||
const innerCollectionField =
|
||||
@ -114,12 +115,10 @@ function _isAllowToSetDefaultValue({
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 表单编辑状态下,不允许设置默认值
|
||||
if (formBlockType === 'update') {
|
||||
// 表单非新建状态下,不允许设置默认值
|
||||
if (formBlockType !== 'create') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
!form?.readPretty &&
|
||||
!isPatternDisabled(fieldSchema) &&
|
||||
|
Loading…
Reference in New Issue
Block a user