Skip to content

Commit 42426dd

Browse files
committed
Don't add empty string in array if it's item has multiselect widget
1 parent 9ee6e45 commit 42426dd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/data.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,19 @@ export function getBlankArray(schema) {
4040
else if (type === 'dict')
4141
type = 'object';
4242

43-
if (type === 'array')
43+
if (type === 'array') {
4444
items.push(getBlankArray(schema.items))
45-
else if (type === 'object')
45+
return items;
46+
}
47+
else if (type === 'object') {
4648
items.push(getBlankObject(schema.items));
47-
else if (type === 'boolean')
49+
return items;
50+
}
51+
52+
if (schema.items.widget === 'multiselect')
53+
return items;
54+
55+
if (type === 'boolean')
4856
items.push(schema.items.default || false);
4957
else if (type === 'integer' || type === 'number')
5058
items.push(schema.items.default || null);

0 commit comments

Comments
 (0)