Skip to content

Commit 8ce3705

Browse files
committed
Fix bug if array.items was a ref
1 parent 7e9bab9 commit 8ce3705

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function getBlankArray(schema, getRef) {
4848
if (schema.items.hasOwnProperty('$ref')) {
4949
// :TODO: this will most probably mutate the original schema
5050
// but i'll fix it later
51-
schema.items = getRef(schema.items['$ref'])
51+
schema.items = getRef(schema.items['$ref']);
5252
}
5353

5454
let type = schema.items.type;

src/ui.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ export function getArrayFormRow(args) {
164164
if (data.length >= max_items)
165165
addable = false;
166166

167+
let isRef = schema.items.hasOwnProperty('$ref');
168+
169+
if (isRef)
170+
schema.items = args.getRef(schema.items['$ref']);
171+
167172
let type = schema.items.type;
168173

169174
if (type === 'list')

0 commit comments

Comments
 (0)