Skip to content

[EuiText] Fixes custom styles #5960

Merged
cchaos merged 6 commits intoelastic:mainfrom
cchaos:fix/text-styles
Jun 8, 2022
Merged

[EuiText] Fixes custom styles #5960
cchaos merged 6 commits intoelastic:mainfrom
cchaos:fix/text-styles

Conversation

@cchaos
Copy link
Copy Markdown
Contributor

@cchaos cchaos commented Jun 8, 2022

The problem:

The new cloning mechanism doesn't respect the custom style attribute.

Screen Shot 2022-06-08 at 10 22 11 AM

The solution:

Fixed for EuiText
Screen Shot 2022-06-08 at 10 21 21 AM

Checklist

  • Checked in both light and dark modes
  • Checked in Chrome, Safari, Edge, and Firefox
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link
Copy Markdown

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

@kibanamachine
Copy link
Copy Markdown

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

@thompsongl thompsongl marked this pull request as ready for review June 8, 2022 17:06
@thompsongl thompsongl requested a review from cee-chen June 8, 2022 17:06
@kibanamachine
Copy link
Copy Markdown

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

const props = { css: cssStyles, ...rest };

if (cloneElement) {
if (isValidElement(children) && cloneElement) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also forgot to mention, great catch on this!

Copy link
Copy Markdown
Contributor

@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.

Thank you for the fix and tests!! 🎉 Not sure if you need to revert the docs change before merge, but otherwise LGTM

@kibanamachine
Copy link
Copy Markdown

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

@kibanamachine
Copy link
Copy Markdown

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

@cchaos cchaos merged commit 83519e7 into elastic:main Jun 8, 2022
@cchaos cchaos deleted the fix/text-styles branch June 8, 2022 20:48
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.

4 participants