fix
This commit is contained in:
@@ -31,6 +31,10 @@ export default function DynamicField({ field, value, onChange, error }: DynamicF
|
||||
|
||||
const renderField = () => {
|
||||
switch (field.fieldType) {
|
||||
case 'REPEATER':
|
||||
// REPEATER fields store data for repeatable sections - don't render as form input
|
||||
return null;
|
||||
|
||||
case 'TEXT':
|
||||
return (
|
||||
<FormInput
|
||||
@@ -178,9 +182,16 @@ export default function DynamicField({ field, value, onChange, error }: DynamicF
|
||||
}
|
||||
};
|
||||
|
||||
const fieldContent = renderField();
|
||||
|
||||
// Don't render anything for null fields (like REPEATER)
|
||||
if (fieldContent === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="dynamic-field" data-field-slug={field.slug}>
|
||||
{renderField()}
|
||||
{fieldContent}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ export type FieldType =
|
||||
| 'DATE'
|
||||
| 'TAG_INPUT'
|
||||
| 'FILE'
|
||||
| 'FILE_UPLOAD';
|
||||
| 'FILE_UPLOAD'
|
||||
| 'REPEATER';
|
||||
|
||||
// Types
|
||||
export interface FieldOption {
|
||||
|
||||
Reference in New Issue
Block a user