Skip to content

Prevents lengend from expanding page#8351

Merged
tylersmalley merged 1 commit intoelastic:masterfrom
tylersmalley:issues/6771
Sep 21, 2016
Merged

Prevents lengend from expanding page#8351
tylersmalley merged 1 commit intoelastic:masterfrom
tylersmalley:issues/6771

Conversation

@tylersmalley
Copy link
Copy Markdown
Member

@tylersmalley tylersmalley commented Sep 19, 2016

Legends will overflow along the y-axis, maintaining a 100% height of the page

screenshot 2016-09-19 15 38 11
screenshot 2016-09-19 15 38 09

Fixes #6771
Fixes #6772

@tylersmalley
Copy link
Copy Markdown
Member Author

@cjcenizal, not sure if you knew of a more preferred way of accomplishing this with flexbox instead of using absolute/relative positioning.

Copy link
Copy Markdown
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

LGTM

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.

I'm not a fan of mixing absolute positioning and flex-box, but this does work.

@cjcenizal
Copy link
Copy Markdown
Contributor

I noticed that this works on Chrome and Safari, but not on Firefox (OS X). Digging into it some more right now...

@cjcenizal
Copy link
Copy Markdown
Contributor

cjcenizal commented Sep 20, 2016

Got it... in visualize.less you need to change:

visualize {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: auto;
  position: relative;

  .k4tip {
    white-space: pre-line;
  }

  .vis-container {
    display: flex;
    flex-direction: row;

    flex: 1 0;

to:

visualize {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: auto;
  position: relative;

  .k4tip {
    white-space: pre-line;
  }

  .vis-container {
    display: flex;
    flex-direction: row;

    flex: 1 1 0;

The last line is the only one that changed. This fixes it for me in Firefox. Still works in Chrome and Safari. Has anyone tested IE?

@thomasneirynck
Copy link
Copy Markdown
Contributor

@cjcenizal @tylersmalley I can test this in IE (annoyign dual boot, right now I'm on linux.... :P)

@thomasneirynck
Copy link
Copy Markdown
Contributor

this doesn't quite work in IE as expected:

left=IE11, right=Chrome53

image

It does work well in Edge.

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.

@cjcenizal IE11 behaves exactly the other way around here.

  • flex: 1 0; works on IE11
  • flex: 1 1 0; does not work on IE11

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.

OK, so I think i have an understanding of this problem. To break it down:

  1. It's a known bug that IE11 ignores unitless flex-basis values in flex shorthand declarations (reference on flexbugs).
  2. The recommended solution to this bug is to use 0%, e.g. flex: 1 1 0%.
  3. However, Firefox has a bug where it doesn't respect 0% as it's supposed to (reference on flexbugs).

So, I think the first thing we should do is double-check the latest version of Firefox and make sure that the bug in point 3 still exists. It's possible I reproduced this bug using an older version of Firefox.

If the bug has been fixed, then we're fine using the 0% solution.

If not, then let's explore using an IE11 CSS Hack to introduce the 0% property after the regular property.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was still an issue in FF 49. The resolution ended up being flex: 1 1 0 for all browsers except IE 11, which I used flex: 1 0

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.

(3) continues to be an issue on FF48

@tylersmalley
Copy link
Copy Markdown
Member Author

tylersmalley commented Sep 21, 2016

screenshot 2016-09-21 09 24 09

**Chrome Version 53.0.2785.116 (64-bit) on OSX:**

screenshot 2016-09-21 08 46 50

Safari Version 9.1.1 (11601.6.17) on OSX:

screenshot 2016-09-21 08 48 00

Firefox Version 49.0 on OSX:

screenshot 2016-09-21 08 48 31

IE Version 11.0.9600.17416 on Windows 8.1:

screenshot 2016-09-21 08 52 28

Microsoft Edge 38.14393.0.0:

screenshot 2016-09-21 08 57 09

@cjcenizal
Copy link
Copy Markdown
Contributor

@tylersmalley FYI we're not supporting IE10 afaik

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.

I know this is kind of stupidly over-the-top, but because this hack is needed to fix a Firefox bug, I think we should elaborate, e.g.:

// Normally we would just set flex: 1 1 0%, which works as expected in IE11.
// Unfortunately, a recent bug in Firefox causes this rule to be ignored, so we
// have to use an IE-specific hack instead.

* Legends will overflow along the y-axis, maintaining a 100% height of the page
* With these changes, space-between would at times place the text out of view

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
@spalger
Copy link
Copy Markdown
Contributor

spalger commented Sep 21, 2016

LGTM

@cjcenizal
Copy link
Copy Markdown
Contributor

LGTM2

@tylersmalley tylersmalley merged commit 66a0ce3 into elastic:master Sep 21, 2016
@tylersmalley tylersmalley deleted the issues/6771 branch September 21, 2016 17:06
elastic-jasper added a commit that referenced this pull request Sep 21, 2016
---------

**Commit 1:**
Prevents lengend from expanding page

* Legends will overflow along the y-axis, maintaining a 100% height of the page
* With these changes, space-between would at times place the text out of view

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Original sha: bb6632f
* Authored by Tyler Smalley <tyler.smalley@elastic.co> on 2016-09-19T21:29:06Z
elastic-jasper added a commit that referenced this pull request Sep 21, 2016
---------

**Commit 1:**
Prevents lengend from expanding page

* Legends will overflow along the y-axis, maintaining a 100% height of the page
* With these changes, space-between would at times place the text out of view

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Original sha: bb6632f
* Authored by Tyler Smalley <tyler.smalley@elastic.co> on 2016-09-19T21:29:06Z
tylersmalley added a commit that referenced this pull request Sep 21, 2016
---------

**Commit 1:**
Prevents lengend from expanding page

* Legends will overflow along the y-axis, maintaining a 100% height of the page
* With these changes, space-between would at times place the text out of view

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Original sha: bb6632f
* Authored by Tyler Smalley <tyler.smalley@elastic.co> on 2016-09-19T21:29:06Z
tylersmalley added a commit that referenced this pull request Sep 21, 2016
[backport] PR #8351 to 5.0 - Prevents lengend from expanding page
tylersmalley added a commit that referenced this pull request Sep 21, 2016
[backport] PR #8351 to 5.x - Prevents lengend from expanding page
@epixa epixa mentioned this pull request Oct 8, 2016
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
---------

**Commit 1:**
Prevents lengend from expanding page

* Legends will overflow along the y-axis, maintaining a 100% height of the page
* With these changes, space-between would at times place the text out of view

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Original sha: 943381bf8e3a523844d27c88f8d6f43b19e5cd52 [formerly bb6632f]
* Authored by Tyler Smalley <tyler.smalley@elastic.co> on 2016-09-19T21:29:06Z


Former-commit-id: fbf3048
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
[backport] PR elastic#8351 to 5.x - Prevents lengend from expanding page

Former-commit-id: 9876c88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants