diff --git a/lib/index.js b/lib/index.js index 997cc28..b6b22e2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -69,6 +69,10 @@ function renderValue(name, value, path) { } function renderList(name, value, path) { + // Render an empty input for a list if it contains nothing + if (!value || value.length === 0) { + return render(name, '', path); + } return value.map(function (c) { return render([name, ''], c, path); }); diff --git a/src/index.js b/src/index.js index e74bdf9..a0e2ab9 100644 --- a/src/index.js +++ b/src/index.js @@ -55,6 +55,10 @@ function renderValue (name, value, path) { } function renderList (name, value, path) { + // Render an empty input for a list if it contains nothing + if (!value || value.length === 0) { + return render(name, '', path) + } return value.map((c) => { return render([name, ''], c, path) })