vazco / uniforms

A React library for building forms from any schema.
https://uniforms.tools
MIT License
1.93k stars 239 forks source link

Array of arrays of object not showing inputs #1317

Open mariusrak opened 3 months ago

mariusrak commented 3 months ago

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,
                        }),
                ],
        }),
})