diff --git a/src/js/helpers.js b/src/js/helpers.js index 19556e78c..3a09d90c8 100755 --- a/src/js/helpers.js +++ b/src/js/helpers.js @@ -368,7 +368,7 @@ export default class Helpers { }) } - previewData = trimObj(previewData) + previewData = trimObj(previewData, true) previewData.className = _this.classNames(field, previewData) diff --git a/src/js/utils.js b/src/js/utils.js index 3aac22f2f..1ec54f0fe 100755 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -17,8 +17,11 @@ window.fbEditors = { * @param {Object} attrs {attrName: attrValue} * @return {Object} Object trimmed of null or undefined values */ -export const trimObj = function(attrs) { +export const trimObj = function(attrs, removeFalse = false) { const xmlRemove = [null, undefined, ''] + if (removeFalse) { + xmlRemove.push(false) + } for (const attr in attrs) { if (xmlRemove.includes(attrs[attr])) { delete attrs[attr]