diff --git a/playground/samples/index.js b/playground/samples/index.js index 8eba6cc825..1527696cc1 100644 --- a/playground/samples/index.js +++ b/playground/samples/index.js @@ -29,5 +29,5 @@ export const samples = { Validation: validation, Files: files, Single: single, - "Custom Array": customArray + "Custom Array": customArray, }; diff --git a/playground/samples/references.js b/playground/samples/references.js index 5131c4b983..2cf8dcd11e 100644 --- a/playground/samples/references.js +++ b/playground/samples/references.js @@ -9,6 +9,18 @@ module.exports = { state: { type: "string" } }, required: ["street_address", "city", "state"] + }, + node: { + type: "object", + properties: { + name: {type: "string"}, + children: { + type: "array", + items: { + $ref: "#/definitions/node" + } + } + } } }, type: "object", @@ -20,11 +32,15 @@ module.exports = { shipping_address: { title: "Shipping address", $ref: "#/definitions/address" + }, + tree: { + title: "Recursive references", + $ref: "#/definitions/node" } } }, uiSchema: { - "ui:order": ["shipping_address", "billing_address"] + "ui:order": ["shipping_address", "billing_address", "tree"] }, formData: { billing_address: { @@ -36,6 +52,12 @@ module.exports = { street_address: "221B, Baker Street", city: "London", state: "N/A" + }, + tree: { + name: "root", + children: [ + {name: "leaf"} + ] } } }; diff --git a/src/components/widgets/TextareaWidget.js b/src/components/widgets/TextareaWidget.js index 70aa3d9f40..7bcb03b263 100644 --- a/src/components/widgets/TextareaWidget.js +++ b/src/components/widgets/TextareaWidget.js @@ -15,7 +15,7 @@ function TextareaWidget({ }) { const _onChange = ({target: {value}}) => { return onChange(value === "" ? undefined : value); - }; + }; return (