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

How do I mix EuiHighlight and EuiCode now that both expect strings? #2437

Closed
bevacqua opened this issue Oct 15, 2019 · 2 comments · Fixed by #2792
Closed

How do I mix EuiHighlight and EuiCode now that both expect strings? #2437

bevacqua opened this issue Oct 15, 2019 · 2 comments · Fixed by #2792
Assignees
Labels

Comments

@bevacqua
Copy link
Contributor

Used to have this:

<EuiCode>
  <EuiHighlight search='ce9'>abce9d</EuiHighlight>
</EuiCode>

But now EuiCode complains about not having a string passed as children. Similar but different use case:

<EuiCode>
  <del>abce9d</del>
</EuiCode>

We had to swap EuiCode and del in this case, and that causes the strikethrough text to extend past the boundaries of the EuiCode box, which isn't as clean as it was before in terms of look & feel

@chandlerprall
Copy link
Contributor

chandlerprall commented Oct 16, 2019

The change to EuiCode making it want a string was done in #2324, for these two bugs:

  • "copy" button expects the value to be a single string
  • dynamic content does not get reflected

With the use cases @bevacqua has brought up, it highlights (hehe) EuiCode's ability to use existing DOM markup in its presentation, and forcing string values removes that ability. I think the change to EuiCode needs to be revisted (and undone), and a new solution for these bugs found.

  • EuiInnerText should be able to power copying
  • wrapping EuiCode's output in a div will probably solve the dynamic content issue, if I remember the bug correctly

@bevacqua
Copy link
Contributor Author

🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants