diff --git a/README.md b/README.md index 2ad800b250..0d8665cfbf 100644 --- a/README.md +++ b/README.md @@ -793,6 +793,7 @@ The following props are passed to each `ArrayFieldTemplate`: - `readonly`: A boolean value stating if the array is readonly. - `required`: A boolean value stating if the array is required. - `schema`: The schema object for this array. +- `uiSchema`: The uiSchema object for this array field. - `title`: A string value containing the title for the array. - `formContext`: The `formContext` object that you passed to Form. diff --git a/src/components/fields/ArrayField.js b/src/components/fields/ArrayField.js index 0f9e1d37fb..6c59dc5ed9 100644 --- a/src/components/fields/ArrayField.js +++ b/src/components/fields/ArrayField.js @@ -323,6 +323,7 @@ class ArrayField extends Component { DescriptionField, disabled, idSchema, + uiSchema, onAddClick: this.onAddClick, readonly, required, @@ -475,13 +476,14 @@ class ArrayField extends Component { readonly, required, schema, + uiSchema, title, TitleField, }; // Check if a custom template template was passed in - const renderFunction = ArrayFieldTemplate || DefaultFixedArrayFieldTemplate; - return renderFunction(arrayProps); + const Template = ArrayFieldTemplate || DefaultFixedArrayFieldTemplate; + return ; } renderArrayFieldItem(props) { diff --git a/test/ArrayFieldTemplate_test.js b/test/ArrayFieldTemplate_test.js index 128d1ec1a3..b36a35c1eb 100644 --- a/test/ArrayFieldTemplate_test.js +++ b/test/ArrayFieldTemplate_test.js @@ -19,7 +19,7 @@ describe("ArrayFieldTemplate", () => { describe("Custom ArrayFieldTemplate of string array", () => { function ArrayFieldTemplate(props) { return ( -