From 93c14eb2c69570cd364d10bbb43d344fd3ffc634 Mon Sep 17 00:00:00 2001 From: "Jason.Chuah" Date: Tue, 27 Jun 2023 10:47:01 +0800 Subject: [PATCH] issue#103 Adding new item to an array doesnt show default values when Initial Data is passed --- src/js/brutusin-json-forms.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/brutusin-json-forms.js b/src/js/brutusin-json-forms.js index 49ee5ea..f1da237 100644 --- a/src/js/brutusin-json-forms.js +++ b/src/js/brutusin-json-forms.js @@ -1200,6 +1200,9 @@ if (typeof brutusin === "undefined") { if (!value) { if (typeof initialValue !== "undefined" && initialValue !== null) { value = getInitialValue(id); + if (value === null && typeof s.default !== "undefined") { + value = s.default; + } } else { value = s.default; }