diff --git a/CHANGELOG.md b/CHANGELOG.md index e3e8b95a65b..6360c674459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Added `numActiveFilters` prop to `EuiFilterButton` ([#1589](https://github.com/elastic/eui/pull/1589)) - Updated style of `EuiFilterButton` to match `EuiFacetButton` ([#1589](https://github.com/elastic/eui/pull/1589)) - Added `size` and `color` props to `EuiNotificationBadge` ([#1589](https://github.com/elastic/eui/pull/1589)) +- Allow `EuiDescribedFormGroup` to exist as a description-only row ([#1522](https://github.com/elastic/eui/pull/1522)) **Bug fixes** @@ -13,6 +14,7 @@ - Adds missing `hasActiveFilters` prop for `EuiFilterButton` type and fixes `onChange` signature for `EuiButtonGroup` ([#1603](https://github.com/elastic/eui/pull/1603)) - Included `react-datepicker` TS types in EUI itself to avoid outside dependency ([#1618](https://github.com/elastic/eui/pull/1618)) - Prevent `EuiGlobalToastList` from attempting calculations on `null` DOM elements ([#1606](https://github.com/elastic/eui/pull/1606)) +- Fixed `EuiFormRow` errors from the possibility of having duplicate `key` values ([#1522](https://github.com/elastic/eui/pull/1522)) **Breaking changes** diff --git a/src/components/form/described_form_group/described_form_group.js b/src/components/form/described_form_group/described_form_group.js index bff5751531f..8b0f13d260f 100644 --- a/src/components/form/described_form_group/described_form_group.js +++ b/src/components/form/described_form_group/described_form_group.js @@ -101,7 +101,7 @@ EuiDescribedFormGroup.propTypes = { /** * One or more `EuiFormRow`s */ - children: PropTypes.node.isRequired, + children: PropTypes.node, className: PropTypes.string, /** * Passed to `EuiFlexGroup` diff --git a/src/components/form/form_row/form_row.js b/src/components/form/form_row/form_row.js index 3694d5fd173..4fc557e5eb5 100644 --- a/src/components/form/form_row/form_row.js +++ b/src/components/form/form_row/form_row.js @@ -93,11 +93,14 @@ export class EuiFormRow extends Component { if (error && isInvalid) { const errorTexts = Array.isArray(error) ? error : [error]; - optionalErrors = errorTexts.map((error, i) => ( - - {error} - - )); + optionalErrors = errorTexts.map((error, i) =>{ + const key = typeof error === 'string' ? error : i; + return ( + + {error} + + );} + ); } let optionalLabel;