From 2ef67f2261cc783cabfec3ab3145259a6c3348cd Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 3 Feb 2020 13:25:33 -0700 Subject: [PATCH 1/4] Remove extra div wrapping around EuiCode contents --- .../__snapshots__/_code_block.test.js.snap | 24 ++------ .../code/__snapshots__/code.test.js.snap | 4 +- .../__snapshots__/code_block.test.js.snap | 60 +++++-------------- src/components/code/_code_block.js | 4 +- 4 files changed, 25 insertions(+), 67 deletions(-) diff --git a/src/components/code/__snapshots__/_code_block.test.js.snap b/src/components/code/__snapshots__/_code_block.test.js.snap index 061ef4b85647..71853e13d0a5 100644 --- a/src/components/code/__snapshots__/_code_block.test.js.snap +++ b/src/components/code/__snapshots__/_code_block.test.js.snap @@ -9,9 +9,7 @@ exports[`EuiCodeBlockImpl block highlights javascript code, adding "js" class 1` > -
- + />
`; @@ -28,10 +26,8 @@ exports[`EuiCodeBlockImpl block renders a pre block tag 1`] = ` class="euiCodeBlock__code" data-test-subj="test subject string" > -
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -46,9 +42,7 @@ exports[`EuiCodeBlockImpl block renders with transparent background 1`] = ` > -
- + />
`; @@ -59,9 +53,7 @@ exports[`EuiCodeBlockImpl inline highlights javascript code, adding "js" class 1 > -
- + /> `; @@ -74,10 +66,8 @@ exports[`EuiCodeBlockImpl inline renders an inline code tag 1`] = ` class="euiCodeBlock__code" data-test-subj="test subject string" > -
- var some = 'code'; + var some = 'code'; console.log(some); -
`; @@ -88,8 +78,6 @@ exports[`EuiCodeBlockImpl inline renders with transparent background 1`] = ` > -
- + /> `; diff --git a/src/components/code/__snapshots__/code.test.js.snap b/src/components/code/__snapshots__/code.test.js.snap index 500e653a4fc7..09b5bfe4f3a5 100644 --- a/src/components/code/__snapshots__/code.test.js.snap +++ b/src/components/code/__snapshots__/code.test.js.snap @@ -9,10 +9,8 @@ exports[`EuiCode renders a code snippet 1`] = ` class="euiCodeBlock__code" data-test-subj="test subject string" > -
- var some = 'code'; + var some = 'code'; console.log(some); -
`; diff --git a/src/components/code/__snapshots__/code_block.test.js.snap b/src/components/code/__snapshots__/code_block.test.js.snap index 3ef7eb0328ac..e279826b59a8 100644 --- a/src/components/code/__snapshots__/code_block.test.js.snap +++ b/src/components/code/__snapshots__/code_block.test.js.snap @@ -5,10 +5,8 @@ exports[`EuiCodeBlock dynamic content updates DOM when input changes 1`] = `
       
-        
- constvalue = - 'State 1' -
+ constvalue = + 'State 1'
@@ -20,10 +18,8 @@ exports[`EuiCodeBlock dynamic content updates DOM when input changes 2`] = `
       
-        
- constvalue = - 'State 2' -
+ constvalue = + 'State 2'
@@ -40,10 +36,8 @@ exports[`EuiCodeBlock props fontSize l is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -59,10 +53,8 @@ exports[`EuiCodeBlock props fontSize m is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -78,10 +70,8 @@ exports[`EuiCodeBlock props fontSize s is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -97,10 +87,8 @@ exports[`EuiCodeBlock props isCopyable is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
-
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -165,10 +151,8 @@ exports[`EuiCodeBlock props overflowHeight is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
-
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -223,10 +205,8 @@ exports[`EuiCodeBlock props paddingSize m is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -242,10 +222,8 @@ exports[`EuiCodeBlock props paddingSize none is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -261,10 +239,8 @@ exports[`EuiCodeBlock props paddingSize s is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -280,10 +256,8 @@ exports[`EuiCodeBlock props transparentBackground is rendered 1`] = ` -
- var some = 'code'; + var some = 'code'; console.log(some); -
@@ -301,10 +275,8 @@ exports[`EuiCodeBlock renders a code block 1`] = ` class="euiCodeBlock__code" data-test-subj="test subject string" > -
- var some = 'code'; + var some = 'code'; console.log(some); -
diff --git a/src/components/code/_code_block.js b/src/components/code/_code_block.js index 95858a8845cc..56129571c50d 100644 --- a/src/components/code/_code_block.js +++ b/src/components/code/_code_block.js @@ -152,7 +152,7 @@ export class EuiCodeBlockImpl extends Component { if (inline) { return ( <> - {createPortal(
{children}
, this.codeTarget)} + {createPortal(children, this.codeTarget)} {codeSnippet} ); @@ -272,7 +272,7 @@ export class EuiCodeBlockImpl extends Component { return ( <> - {createPortal(
{children}
, this.codeTarget)} + {createPortal(children, this.codeTarget)} {(innerTextRef, innerText) => { const codeBlockControls = getCodeBlockControls(innerText); From 05d820fb903f467e404ada210b232ad5669a5bbb Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 3 Feb 2020 13:32:02 -0700 Subject: [PATCH 2/4] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1030746d3b8c..95edb944ecff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Exported missing `EuiSelectProps` type ([#2815](https://github.com/elastic/eui/pull/2815)) - Fixed `EuiCode`'s & `EuiCodeBlock`'s ability to accept non-string children ([#2792](https://github.com/elastic/eui/pull/2792)) +- Reverted a bug in `EuiCode`'s & `EuiCodeBlock` layout positioning on Firefox ([#2820](https://github.com/elastic/eui/pull/2820)) - Fixed `EuiSearchBar`, `Query`, and `AST`'s ability to accept literal parenthesis characters ([#2791](https://github.com/elastic/eui/pull/2791)) **Breaking changes** From 9fa2b0d3b2c5516b76967b50328c0b8b152bcb4b Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 3 Feb 2020 13:57:45 -0700 Subject: [PATCH 3/4] unchangelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95edb944ecff..1030746d3b8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,6 @@ - Exported missing `EuiSelectProps` type ([#2815](https://github.com/elastic/eui/pull/2815)) - Fixed `EuiCode`'s & `EuiCodeBlock`'s ability to accept non-string children ([#2792](https://github.com/elastic/eui/pull/2792)) -- Reverted a bug in `EuiCode`'s & `EuiCodeBlock` layout positioning on Firefox ([#2820](https://github.com/elastic/eui/pull/2820)) - Fixed `EuiSearchBar`, `Query`, and `AST`'s ability to accept literal parenthesis characters ([#2791](https://github.com/elastic/eui/pull/2791)) **Breaking changes** From be901d00f7df4698416eec5d07c64b5296425103 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 3 Feb 2020 14:00:24 -0700 Subject: [PATCH 4/4] kinda changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1030746d3b8c..398e39290be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ **Bug fixes** - Exported missing `EuiSelectProps` type ([#2815](https://github.com/elastic/eui/pull/2815)) -- Fixed `EuiCode`'s & `EuiCodeBlock`'s ability to accept non-string children ([#2792](https://github.com/elastic/eui/pull/2792)) +- Fixed `EuiCode`'s & `EuiCodeBlock`'s ability to accept non-string children ([#2792](https://github.com/elastic/eui/pull/2792)) ([#2820](https://github.com/elastic/eui/pull/2820)) - Fixed `EuiSearchBar`, `Query`, and `AST`'s ability to accept literal parenthesis characters ([#2791](https://github.com/elastic/eui/pull/2791)) **Breaking changes**