Skip to content

Commit

Permalink
Merge pull request #1413 from lucasnetau/booleanTypeAttrDetect
Browse files Browse the repository at this point in the history
Ensure we do not corrupt the userTypeAttr definition when encountering a boolean false value
  • Loading branch information
kevinchappell authored Sep 21, 2023
2 parents 614a92f + 317d778 commit ce9cd2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ function FormBuilder(opts, element, $) {
if (attrValType !== 'undefined') {
const orig = mi18n.get(attribute)
const tUA = typeUserAttr[attribute]
const origValue = tUA.value || ''
tUA.value = values[attribute] || tUA.value || ''
const origValue = attrValType === 'boolean' ? tUA.value : (tUA.value || '')
tUA.value = values[attribute] || origValue

if (tUA.label) {
i18n[attribute] = Array.isArray(tUA.label) ? mi18n.get(...tUA.label) || tUA.label[0] : tUA.label
Expand Down

0 comments on commit ce9cd2e

Please sign in to comment.