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

Fix overflowHeight in EuiCodeBlock #2487

Merged
merged 7 commits into from
Oct 25, 2019

Conversation

andreadelrio
Copy link
Contributor

Summary

Fixing issue where EuiCodeBlock always expands to given overflowHeight even when content does not require it. Fixes #2435

Checklist

- [ ] Checked in dark mode
- [ ] Checked in mobile

  • Checked in IE11 and Firefox
    - [ ] 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
  • A changelog entry exists and is marked appropriately

Copy link
Contributor

@snide snide left a 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.

@@ -255,7 +257,9 @@ export class EuiCodeBlockImpl extends Component {

return (
<div {...wrapperProps}>
<pre className="euiCodeBlock__pre">{codeSnippet}</pre>
<pre style={preOptionalStyles} className="euiCodeBlock__pre">
Copy link
Contributor

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))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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?

@andreadelrio andreadelrio merged commit c7cb88b into elastic:master Oct 25, 2019
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.

EuiCodeBlock always expands to overflowHeight
2 participants