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 IE specific flexbox min-height issue #66555

Merged
merged 7 commits into from
May 19, 2020

Conversation

sulemanof
Copy link
Contributor

@sulemanof sulemanof commented May 14, 2020

Summary

Fixes #66282

Regression after #64018

Seems this is trapped into known IE bug:
flex items ignore their parent container’s height if it’s set via the min-height property

The bug is fully described here

One of the workarounds is to replace it with the height instead.
Seems to be working fine across all browsers. Didn't find any issues.
Checked against Chrome/Firefox/Edge/IE11 across apps: Visualize, Dashboard, Graph, Canvas, Home, Dev Tools, Management.

image

This also fixes #66586

image

The fix based on adding flex-basis: auto to let container inherit the height of its descendant.

This also fixes wrong height calculation of visualization on small screens in IE:
the editors overflows a visualization

image

Checklist

For maintainers

Comment on lines 76 to 79
min-height: calc(100vh - #{$euiHeaderHeightCompensation});
// IE needs this to be "height" instead of "min-height"
// "min-height" causes a bug described in the next link
// https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
height: calc(100vh - #{$euiHeaderHeightCompensation});
Copy link
Contributor

Choose a reason for hiding this comment

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

The problem with this switch is that the scrolls now must be managed by internal views. Not a huge deal, but we really try to keep the window scroll on the window instead of an individual element. If this problem truly only affected IE, let's keep min-height by default but change to height only for IE:

  min-height: calc(100vh - #{$euiHeaderHeightCompensation});

  @include internetExplorerOnly {
    // IE needs this to be "height" instead of "min-height"
    // "min-height" causes a bug described in the next link
    // https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
    height: calc(100vh - #{$euiHeaderHeightCompensation});
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cchaos thanks for useful suggestion!
Done.

@sulemanof
Copy link
Contributor Author

This also helped to reveal another IE specific bug in visualize, a separate issue created #66586

ie_editor

@sulemanof
Copy link
Contributor Author

@elasticmachine merge upstream

@sulemanof sulemanof requested a review from cchaos May 15, 2020 07:58
@sulemanof sulemanof marked this pull request as ready for review May 15, 2020 07:58
@sulemanof sulemanof requested a review from a team as a code owner May 15, 2020 07:58
@sulemanof sulemanof added :KibanaApp/fix-it-week Team:Visualizations Visualization editors, elastic-charts and infrastructure labels May 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@sulemanof sulemanof requested a review from a team May 15, 2020 11:13

// a hack for IE, issue: https://github.com/elastic/kibana/issues/66586
> .visEditorSidebar__formWrapper {
flex-basis: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this should be wrapped with internetExplorerOnly mixin.
Checked in all browsers except Safari, works fine.
Actually, this just overwrites EUI rule, which seems was created for another IE bug 😄 :

image

@@ -70,8 +70,7 @@

.visEditor__visualization {
display: flex;
flex-basis: 100%;
flex: 1;
flex: 1 1 auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes another bug:
the editors overflows a visualization on small screens, the image attached in PR description.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment for this one as well so it doesn't get removed?

@sulemanof
Copy link
Contributor Author

I tested this across Chrome/Firefox/Edge/IE11 and didn't find any other issues, all is working fine across all visualization types. Some of examples attached below:

  • Chrome

small screen, area vis:

chrome_small_screen_with_data

wide screen:

chrome_wide_screen_with_data

wide screen without data:

chrome_wide_screen_no_data

  • Firefox
    Vega vis, small screen

firefox_small_screen

Data table vis, playing around with different screen sizes, inner scrollbars
video recorded

  • IE11, the party owner 🥳

playing around with Gauge vis on different screen sizes
video recorded

even Data table vis is working fine, wow 😎
video recorded

The only browser I can't check in is Safari, so I would ask reviewers to do it 🙏

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested in Safari and IE didn't notice any breakages

@sulemanof
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

I couldn't test in IE. I kept getting redirect errors, so I'll have to trust your testing in there. I did test, however, in Safari for you. I didn't notice any regressions in the visualize editor. 👍

@@ -70,8 +70,7 @@

.visEditor__visualization {
display: flex;
flex-basis: 100%;
flex: 1;
flex: 1 1 auto;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment for this one as well so it doesn't get removed?

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@sulemanof sulemanof merged commit 428fd06 into elastic:master May 19, 2020
@sulemanof sulemanof deleted the fix/ie_flexbox_height branch May 19, 2020 06:50
sulemanof added a commit to sulemanof/kibana that referenced this pull request May 19, 2020
* Fix IE specific flexbox min-height issue

* Use internetExplorerOnly mixin

* Fix other issues in IE

* Add a comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 19, 2020
* master: (24 commits)
  [APM] agent config 'profiling_inferred_spans_min_duration' default value is '0ms' but the min value in the field is '1ms' (elastic#66886)
  [Canvas] Fix flaky custom element functional tests (elastic#65908)
  Fix IE specific flexbox min-height issue (elastic#66555)
  [Discover] Unskip doc link functional test (elastic#66884)
  Index pattern management to Kibana platform (elastic#65026)
  Warning and link to support matrix for IE11 (elastic#66512)
  [Reporting] Consolidate Server Type Defs, move some out of Legacy (elastic#66144)
  [SIEM] [Maps] Fixes Network Map empty tooltip (elastic#66828)
  [Endpoint] Encode the index of the alert in the id response (elastic#66919)
  [services/testSubjects] reduce retry usage, add waitForEnabled (elastic#66538)
  [DOCS] Identifies cloud settings for APM (elastic#66935)
  [SIEM][CASE] Fix configuration's page user experience (elastic#66029)
  Resolver: Display node 75% view submenus (elastic#64121)
  [SIEM] Cases] Capture timeline click and open timeline in case view (elastic#66327)
  [APM] Lowercase agent names so icons work (elastic#66824)
  [dev/cli] add support for --no-cache (elastic#66837)
  [Ingest Manager] Better handling of package installation problems (elastic#66541)
  [ML] Enhances api docs for modules endpoints (elastic#66738)
  dont hide errors (elastic#66764)
  [RFC] Global search API (elastic#64284)
  ...
sulemanof added a commit that referenced this pull request May 19, 2020
* Fix IE specific flexbox min-height issue

* Use internetExplorerOnly mixin

* Fix other issues in IE

* Add a comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
sulemanof added a commit that referenced this pull request May 19, 2020
* Fix IE specific flexbox min-height issue

* Use internetExplorerOnly mixin

* Fix other issues in IE

* Add a comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported IE11 release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.8.0 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default editor rendered incorrectly in IE11 Visualize doesn't render right in IE 11
5 participants