From 512e75f7f69bea4c73da976e3ad9427f995ecc09 Mon Sep 17 00:00:00 2001 From: SPGoding Date: Mon, 30 Dec 2019 10:38:42 -0600 Subject: [PATCH] Fix #58 --- js/view.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/view.js b/js/view.js index a7992a8d..69f67f75 100644 --- a/js/view.js +++ b/js/view.js @@ -440,6 +440,12 @@ function generateObject(data, struct, options) { $body.append($field); } } + if (struct.card === false) { + // Note: JSON.parse(JSON.stringify(out)) can remove undefined values in the out object. + if (Object.keys(JSON.parse(JSON.stringify(out))).length === 0) { + out = undefined + } + } $body.children().first().children('button').removeClass('mt-3'); $body.children().first().removeClass('mt-3'); return {out: out, component: $el};