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