diff --git a/packages/ui/components/VisualEditor/PropertyControls.tsx b/packages/ui/components/VisualEditor/PropertyControls.tsx index d8b6d8e18..3d6767eb4 100644 --- a/packages/ui/components/VisualEditor/PropertyControls.tsx +++ b/packages/ui/components/VisualEditor/PropertyControls.tsx @@ -31,11 +31,18 @@ const PropertyControls: React.FC = ({ onAdd, schemaPath, const fullPath = schemaPath ? `${schemaPath}.properties.${key}` : `properties.${key}`; console.log('Full Full Path :)', fullPath); console.log(`Adding new property at: ${fullPath}`); - + onAdd(fullPath, { type, ...(type === 'object' && { properties: {} }), - ...(type === 'array' && { items: { type: itemType } }) + ...(type === 'array' && { + items: (itemType !== 'object') + ? { type: itemType } + : { + type: 'object', + properties: {}, + } + }) } as any); setKey('');