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

Require that FormRow has exactly one child element #2054

Merged

Conversation

wylieconlon
Copy link

@wylieconlon wylieconlon commented Jun 18, 2019

Summary

EuiFormRow requires exactly one child element to work, which was too loose at runtime and compile time. This adds stricter type checks and a proptype check. The error messages are now much easier to follow:

Closes #1931

Screenshots showing updated errors:

Screenshot 2019-06-18 14 10 02

Screenshot 2019-06-18 14 13 06

Checklist

  • [ ] This was checked in mobile
  • [ ] This was checked in IE11
  • [ ] This was checked in dark mode
  • Any props added have proper autodocs
  • Documentation examples were added
  • A changelog entry exists and is marked appropriately
  • This was checked for breaking changes and labeled appropriately
  • Jest tests were updated or added to match the most common scenarios
  • [ ] This was checked against keyboard-only and screenreader scenarios
  • This required updates to Framer X components

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cchaos cchaos requested a review from thompsongl June 18, 2019 19:03
@thompsongl
Copy link
Contributor

jenkins test this

1 similar comment
@thompsongl
Copy link
Contributor

jenkins test this

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Don't forget to add a changelog entry

CHANGELOG.md Outdated Show resolved Hide resolved
@wylieconlon
Copy link
Author

retest

@wylieconlon wylieconlon merged commit 83b2832 into elastic:master Jun 25, 2019
@wylieconlon wylieconlon deleted the formrow-warn-multiple-children branch June 25, 2019 20:54
@ryankeairns
Copy link
Contributor

Thanks @wylieconlon !!

@snide snide mentioned this pull request Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad error message when EuiFormRow has two children
5 participants