vazco / uniforms

A React library for building forms from any schema.

Home Page:https://uniforms.tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Array of arrays of object not showing inputs

mariusrak opened this issue · comments

Hi, this schema produces no inputs:

new SimpleSchema2Bridge({
        schema: new SimpleSchema({
                items: Array,
                "items.$": [
                        new SimpleSchema({
                                question: String,
                                answer: String,
                        }),
                ],
        }),
})

Just put it in the playground and try. Doesn't work even with simple objects

new SimpleSchema2Bridge({
        schema: new SimpleSchema({
                items: Array,
                "items.$": Array,
                "items.$.$": Object,
                "items.$.question": String,
                "items.$.answer": String,
        }),
})

Or even with just string nested twice

new SimpleSchema2Bridge({
        schema: new SimpleSchema({
                items: Array,
                "items.$": Array,
                "items.$.$": Object,
                "items.$.$.question": String,
        }),
})

When nesting is broken down by object it works:

new SimpleSchema2Bridge({
        schema: new SimpleSchema({
                items: Array,
                "items.$": Object,
                "items.$.content": [
                        new SimpleSchema({
                                question: String,
                                answer: String,
                        }),
                ],
        }),
})