From 6f7229ba8ad0a0940bfc83795215b8057b071219 Mon Sep 17 00:00:00 2001 From: James Lucas Date: Thu, 14 Nov 2024 11:49:21 +1100 Subject: [PATCH] fix: options attribute is stored in 'values' key, custom options are stored in attribute name key --- src/js/form-builder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) {