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

Properly render an example's html output in the Demo HTML tab #2718

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Dec 26, 2019

Summary

Fixes #2713 and fixes #2711

Two issues I found:

  • Any example source that returns a <Fragment> (e.g. list_group.js only rendered the first child's html
  • The rendered content didn't include the root node's HTML, so every Demo HTML tab in our docs has been missing it's top-most wrapping element.

Both of these are fixed by wrapping the rendered source component in a div.

@thompsongl for code review
@snide / @cchaos to double check the Demo HTML output

Checklist

- [ ] Check against all themes for compatability in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in IE11 and Firefox
- [ ] Props have proper autodocs

  • Added documentation examples
    - [ ] Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
    - [ ] A changelog entry exists and is marked appropriately

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.

Code changes and output both look good

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

👍 Fixes those issues and I didn't see any regressions of existing examples. Perhaps unrelated, but none of the DataGrid examples display the HTML.

@chandlerprall
Copy link
Contributor Author

Will look into the datagrid's lack of HTML separately. Took a peek, looks like a different issue.

@chandlerprall chandlerprall merged commit 9126176 into elastic:master Jan 2, 2020
@chandlerprall chandlerprall deleted the bug/2713-documentation-not-rendering-all-fragment-children branch January 2, 2020 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants