-
Notifications
You must be signed in to change notification settings - Fork 843
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
Fix overflowHeight in EuiCodeBlock #2487
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked in all three browsers. Method is good, just some small code cleanup, then good to merge.
src/components/code/_code_block.js
Outdated
@@ -255,7 +257,9 @@ export class EuiCodeBlockImpl extends Component { | |||
|
|||
return ( | |||
<div {...wrapperProps}> | |||
<pre className="euiCodeBlock__pre">{codeSnippet}</pre> | |||
<pre style={preOptionalStyles} className="euiCodeBlock__pre"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a difference between optionalStyles
and preOptionalStyles
. Likely you can just use optionalStyles
here and not need to declare an extra const.
CHANGELOG.md
Outdated
@@ -3,6 +3,7 @@ | |||
**Bug fixes** | |||
|
|||
- Normalized button `moz-focus-inner` ([#2445](https://github.com/elastic/eui/pull/2445)) | |||
- Fixed `overflowHeight` in `EuiCodeBlock` ([#2487](https://github.com/elastic/eui/pull/2487)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fixed `overflowHeight` in `EuiCodeBlock` ([#2487](https://github.com/elastic/eui/pull/2487)) | |
- Changed `EuiCodeBlock` so that `overflowHeight` now applies a `maxHeight` instead of a `height` on the block ([#2487](https://github.com/elastic/eui/pull/2487)) |
It's OK to be verbose in change logs. People go to them primarily when things break. Did something change? What was the change?
Summary
Fixing issue where
EuiCodeBlock
always expands to givenoverflowHeight
even when content does not require it. Fixes #2435Checklist
- [ ] Checked in dark mode- [ ] Checked in mobile- [ ] 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