AppliedMathematicsANU / plexus-form

A dynamic form component for react using JSON-Schema.
MIT License
134 stars 31 forks source link

rendering array as a root #38

Open MaxKramnik opened 9 years ago

MaxKramnik commented 9 years ago

I am trying to use a schema that looks like this:

{ "type": "array", "items": { "type": "number" } }

I am getting an input box rendered but it is not possible to type inside.

martijnvermaat commented 9 years ago

Do you provide the values prop? If so, you might want to read about controlled elements and use submitOnChange.

MaxKramnik commented 9 years ago

I tried a simple example that you have in your demo, so no values. Basically, I see that I need to have a wrap object in order to make it work, i.e. { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "number" } } } }

odf commented 9 years ago

I have a feeling this could be another consequence of aggressive pruning, as mentioned in #31.