diff --git a/packages/builder/src/dataBinding.js b/packages/builder/src/dataBinding.js index 8adc27ee59..c89221f163 100644 --- a/packages/builder/src/dataBinding.js +++ b/packages/builder/src/dataBinding.js @@ -1141,10 +1141,11 @@ export const buildFormSchema = (component, asset) => { const fieldSetting = settings.find( setting => setting.key === "field" && setting.type.startsWith("field/") ) - if (fieldSetting && component.field) { + if (fieldSetting) { const type = fieldSetting.type.split("field/")[1] - if (type) { - schema[component.field] = { type } + const key = component.field || component._instanceName + if (type && key) { + schema[key] = { type } } } component._children?.forEach(child => { diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 0feac0ee80..bf7cd78ad9 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -3105,8 +3105,7 @@ { "type": "field/string", "label": "Field", - "key": "field", - "required": true + "key": "field" }, { "type": "text", @@ -3524,8 +3523,7 @@ { "type": "field/options", "label": "Field", - "key": "field", - "required": true + "key": "field" }, { "type": "text", diff --git a/packages/client/src/components/app/forms/Field.svelte b/packages/client/src/components/app/forms/Field.svelte index 846bfa6eef..b2be00ca47 100644 --- a/packages/client/src/components/app/forms/Field.svelte +++ b/packages/client/src/components/app/forms/Field.svelte @@ -35,7 +35,7 @@ $: formStep = formStepContext ? $formStepContext || 1 : 1 $: formField = formApi?.registerField( - field, + field || $component.name, type, defaultValue, disabled,