From 317d7781205286ced4d7445897e557afef3f42f4 Mon Sep 17 00:00:00 2001 From: James Lucas Date: Thu, 14 Sep 2023 11:06:18 +1000 Subject: [PATCH] fix: Ensure boolean false values are kept as boolean false when getting the original value --- src/js/form-builder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/form-builder.js b/src/js/form-builder.js index 86d8bd6e3..ab3ffa742 100644 --- a/src/js/form-builder.js +++ b/src/js/form-builder.js @@ -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