Skip to content

Commit

Permalink
fix: options attribute is stored in 'values' key, custom options are …
Browse files Browse the repository at this point in the history
…stored in attribute name key
  • Loading branch information
lucasnetau committed Nov 14, 2024
1 parent 29b4f23 commit 6f7229b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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)) {
Expand Down

0 comments on commit 6f7229b

Please sign in to comment.