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

[EuiErrorBoundary] Use EuiCodeBlock to render error #5359

Merged
merged 4 commits into from
Nov 9, 2021

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Nov 8, 2021

Fixes #5358

Before the component was just rendering a bare <pre> element, but now the error gets wrapped in our EuiCodeBlock which handles the overflow scrolling and gets rid of some unnecessary custom styles and selectors.

Before
Screen Shot 2021-11-08 at 14 18 27 PM

After
Screen Shot 2021-11-08 at 14 18 07 PM

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • [ ] Props have proper autodocs and playground toggles
  • [ ] Added documentation
  • [ ] Checked Code Sandbox works for any docs examples
  • [ ] Added or updated jest and cypress 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
Member

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Fantastic!!

</div>
<EuiCodeBlock>
<EuiTitle size="xs">
<p>Error</p>
Copy link
Member

Choose a reason for hiding this comment

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

💯 I think changing this to a <p> makes more sense from an accessibility point of view- feel free to chime in if I'm missing something @1Copenut

Copy link
Contributor

Choose a reason for hiding this comment

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

@constancecchen I agree, paragraphs are more meaningful than divs here. It's permissible according to the spec, but this is a step up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For more context, this was actually an <h1> before. I'm not sure how our automated a11y tests didn't catch this page (it's not excluded). But I didn't think that top level heading was appropriate and usually just opt for paragraphs if we can't know for sure where this will lie in DOM hierarchy.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing the page was either excluded or we're not doing best-practices checks. Either way, this works better and is semantically meaningful. I'll change my comment to approved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @1Copenut!

CHANGELOG.md Outdated Show resolved Hide resolved
cchaos and others added 2 commits November 8, 2021 14:35
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5359/

Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

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

LGTM!

@cchaos cchaos merged commit 6e337af into elastic:main Nov 9, 2021
@cchaos cchaos deleted the fix/error_boundary_text_wrap branch November 9, 2021 18:06
@lucasfcosta
Copy link

Thank you for being so quick to address the issue @cchaos! 🙌

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.

[EuiErrorBoundary] Long stack-trace lines overflowing on mobile resolutions
5 participants