Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc form row fixes #1522

Merged
merged 6 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
- 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**

- `EuiBasicTable` select all shows up on mobile ([#1462](https://github.com/elastic/eui/pull/1462))
- 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**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ EuiDescribedFormGroup.propTypes = {
/**
* One or more `EuiFormRow`s
*/
children: PropTypes.node.isRequired,
children: PropTypes.node,
chandlerprall marked this conversation as resolved.
Show resolved Hide resolved
className: PropTypes.string,
/**
* Passed to `EuiFlexGroup`
Expand Down
13 changes: 8 additions & 5 deletions src/components/form/form_row/form_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ export class EuiFormRow extends Component {

if (error && isInvalid) {
const errorTexts = Array.isArray(error) ? error : [error];
optionalErrors = errorTexts.map((error, i) => (
<EuiFormErrorText key={error} id={`${id}-error-${i}`} className="euiFormRow__text">
{error}
</EuiFormErrorText>
));
optionalErrors = errorTexts.map((error, i) =>{
const key = typeof error === 'string' ? error : i;
thompsongl marked this conversation as resolved.
Show resolved Hide resolved
return (
<EuiFormErrorText key={key} id={`${id}-error-${i}`} className="euiFormRow__text">
{error}
</EuiFormErrorText>
);}
);
}

let optionalLabel;
Expand Down