diff --git a/src/js/form-builder.js b/src/js/form-builder.js index 95fbd3d3a..934b4bc01 100644 --- a/src/js/form-builder.js +++ b/src/js/form-builder.js @@ -390,7 +390,7 @@ function FormBuilder(opts, element, $) { * @return {string} field options markup */ const fieldOptions = function (fieldName, fieldData) { - const { type, values } = fieldData + const { type } = fieldData let fieldValues const optionActions = [m('a', mi18n.get('addOption'), { className: 'add add-opt' })] const fieldLabel = fieldName === 'values' ? mi18n.get('selectOptions') : i18n[fieldName] @@ -406,6 +406,7 @@ function FormBuilder(opts, element, $) { } } + const values = fieldName === 'options' ? fieldData['values'] : fieldData[fieldName] if (!values || !values.length) { let defaultOptCount = [1, 2, 3] if (['checkbox-group', 'checkbox'].includes(type)) {