diff --git a/src/lib/forms/ArrayField.js b/src/lib/forms/ArrayField.js index 07304a28..782d56c1 100644 --- a/src/lib/forms/ArrayField.js +++ b/src/lib/forms/ArrayField.js @@ -8,7 +8,7 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { getIn, FieldArray } from "formik"; -import { Form, Icon } from "semantic-ui-react"; +import { Form, Icon, Button } from "semantic-ui-react"; import _isEmpty from "lodash/isEmpty"; import _filter from "lodash/filter"; import _matches from "lodash/matches"; @@ -87,50 +87,50 @@ export class ArrayField extends Component { const { nextKey } = this.state; const valuesToDisplay = this.getValues(values, fieldPath); return ( - - + <> + + - {valuesToDisplay.map((value, index, array) => { - const arrayPath = fieldPath; - const indexPath = index; - const key = value.__key || index; + {valuesToDisplay.map((value, index, array) => { + const arrayPath = fieldPath; + const indexPath = index; + const key = value.__key || index; - return ( -
- {children({ - array, - arrayHelpers, - arrayPath, - indexPath, - key, - value, - ...props, - })} -
- ); - })} + return ( +
+ {children({ + array, + arrayHelpers, + arrayPath, + indexPath, + key, + value, + ...props, + })} +
+ ); + })} +
- + {helpText && } - - { - arrayHelpers.push({ - ...defaultNewValue, - __key: nextKey, - }); - this.setState((state) => ({ nextKey: state.nextKey - 1 })); - }} - > - - {addButtonLabel} - - -
+ + ); };