GithubHelp home page GithubHelp logo

flexbugs's Introduction

⚠️ UPDATE: this repo is no longer maintained, as most of the bugs listed here are fixed in modern browsers.

Flexbugs

This repository is a community-curated list of flexbox issues and cross-browser workarounds for them. The goal is that if you're building a website using flexbox and something isn't working as you'd expect, you can find the solution here.

As the spec continues to evolve and vendors nail down their implementations, this repo will be updated with newly discovered issues and remove old issues as they're fixed or become obsolete. If you discover a bug that's not listed here, please report it so everyone else can benefit.

The bugs and their workarounds

  1. Minimum content sizing of flex items not honored
  2. Column flex items set to align-items: center overflow their container
  3. min-height on a flex container won't apply to its flex items
  4. flex shorthand declarations with unitless flex-basis values are ignored
  5. Column flex items don't always preserve intrinsic aspect ratios
  6. The default flex value has changed
  7. flex-basis doesn't account for box-sizing: border-box
  8. flex-basis doesn't support calc()
  9. Some HTML elements can't be flex containers
  10. align-items: baseline doesn't work with nested flex containers
  11. Min and max size declarations are ignored when wrapping flex items
  12. Inline elements are not treated as flex-items
  13. Importance is ignored on flex-basis when using flex shorthand
  14. Shrink-to-fit containers with flex-flow: column wrap do not contain their items
  15. Column flex items ignore margin: auto on the cross axis
  16. flex-basis cannot be animated
  17. Flex items are not correctly justified when max-width is used

Flexbug #1

Minimum content sizing of flex items not honored

Demos Browsers affected Tracking bugs
1.1.abug
1.1.bworkaround
1.2.abug
1.2.bworkaround
Chrome (fixed in 72)
Opera (fixed in 60)
Safari (fixed in 10)
Chrome #426898 (fixed)
Chrome #596743 (fixed)
Safari #146020 (fixed)

When flex items are too big to fit inside their container, those items are instructed (by the flex layout algorithm) to shrink, proportionally, according to their flex-shrink property. But contrary to what most browsers allow, they're not supposed to shrink indefinitely. They must always be at least as big as their minimum height or width properties declare, and if no minimum height or width properties are set, their minimum size should be the default minimum size of their content.

According to the current flexbox specification:

By default, flex items won’t shrink below their minimum content size (the length of the longest word or fixed-size element). To change this, set the min-width or min-height property.

Workaround

The flexbox spec defines an initial flex-shrink value of 1 but says items should not shrink below their default minimum content size. You can usually get this same behavior by setting a flex-shrink value of 0 (instead of the default 1) and a flex-basis value of auto. That will cause the flex item to be at least as big as its width or height (if declared) or its default content size.

Flexbug #2

Column flex items set to align-items: center overflow their container

Demos Browsers affected
2.1.abug
2.1.bworkaround
Internet Explorer 10-11 (fixed in Edge)

When using align-items: center on a flex container in the column direction, the contents of flex item, if too big, will overflow their container in IE 10-11.

Workaround

Most of the time, this can be fixed by simply setting max-width: 100% on the flex item. If the flex item has a padding or border set, you'll also need to make sure to use box-sizing: border-box to account for that space. If the flex item has a margin, using box-sizing alone will not work, so you may need to use a container element with padding instead.

Flexbug #3

min-height on a flex container won't apply to its flex items

Demos Browsers affected Tracking bugs
3.1.abug
3.1.bworkaround
3.2.abug
3.2.bworkaround
Internet Explorer 10-11 (fixed in Edge) IE #802625 (archived)

In order for flex items to size and position themselves, they need to know how big their containers are. For example, if a flex item is supposed to be vertically centered, it needs to know how tall its parent is. The same is true when flex items are told to grow to fill the remaining empty space.

In IE 10-11, min-height declarations on flex containers work to size the containers themselves, but their flex item children do not seem to know the size of their parents. They act as if no height has been set at all.

Workaround

By far the most common element to apply min-height to is the body element, and usually you're setting it to 100% (or 100vh). Since the body element will never have any content below it, and since having a vertical scroll bar appear when there's a lot of content on the page is usually the desired behavior, substituting height for min-height will almost always work as shown in demo 3.1.b.

For cases where min-height is required, the workaround is to add a wrapper element around the flex container that is itself a flex container in the column direction. For some reason nested flex containers are not affected by this bug. Demo 3.2.a shows a visual design where min-height is required, and demo 3.2.b shows how this bug can be avoided with a wrapper element.

Flexbug #4

flex shorthand declarations with unitless flex-basis values are ignored

Demos Browsers affected
4.1.abug
4.1.bworkaround
Internet Explorer 10-11 (fixed in Edge)

Prior to the release of IE 10, the flexbox spec at the time stated that a flexbox item's preferred size required a unit when using the flex shorthand:

If the <preferred-size> is ‘0’, it must be specified with a unit (like ‘0px’) to avoid ambiguity; unitless zero will either be interpreted as as one of the flexibilities, or is a syntax error.

This is no longer true in the spec, but IE 10-11 still treat it as true. If you use the declaration flex: 1 0 0 in one of these browsers, it will be an error and the entire rule (including all the flexibility properties) will be ignored.

Workaround

When using the flex shorthand, always include a unit in the flex-basis portion. For example: 1 0 0%.

Important: using a flex value of something like 1 0 0px can still be a problem because many CSS minifiers will convert 0px to 0. To avoid this, make sure to use 0% instead of 0px since most minifiers won't touch percentage values for other reasons.

Flexbug #5

Column flex items don't always preserve intrinsic aspect ratios

Demos Browsers affected
5.1.abug
5.1.bworkaround
Internet Explorer 10-11 (fixed in Edge)

The March 2014 spec has the following to say about how size determinations are made for flex items:

On a flex item whose overflow is not visible, this [auto] keyword specifies as the minimum size the smaller of: (a) the min-content size, or (b) the computed width/height, if that value is definite.

Demo 5.1.a contains an image whose height is 200 pixels and whose width is 500 pixels. Its container, however, is only 300 pixels wide, so after the image is scaled to fit into that space, its computed height should only be 120 pixels. The text quoted above does not make it clear as to whether the flex item's min-content size should be based the image's actual height or scaled height.

The most recent spec has resolved this ambiguity in favor of using sizes that will preserve an element's intrinsic aspect ratio.

Workaround

You can avoid this problem by adding a container element to house the element with the intrinsic aspect ratio. Since doing this causes the element with the intrinsic aspect ratio to no longer be a flex item, it will be sized normally.

Flexbug #6

The default flex value has changed

Demos Browsers affected
6.1.abug
6.1.bworkaround
6.2.abug
6.2.bworkaround
Internet Explorer 10 (fixed in 11)

When IE 10 was being developed, the March 2012 spec said the initial value for the flex property was none, which translates to 0 0 auto. The most recent spec sets the initial flex value to the initial values of the individual flexibility properties, which corresponds to initial or 0 1 auto. Notice that this means IE 10 uses a different initial flex-shrink value (technically it was called neg-flex in the spec at the time) from every other browser. Other browsers (including IE 11) use an initial value of 1 rather than 0.

This bug can manifest itself in two ways: when not setting any flex values or when using one of the flex shorthands. In both cases, flex items in IE 10 will behave differently from all other browsers. The following table illustrates the difference:

Declaration What it should mean What it means in IE 10
(no flex declaration) flex: 0 1 auto flex: 0 0 auto
flex: 1 flex: 1 1 0% flex: 1 0 0px
flex: auto flex: 1 1 auto flex: 1 0 auto
flex: initial flex: 0 1 auto flex: 0 0 auto

Workaround

If you have to support IE 10, the best solution is to always set an explicit flex-shrink value on all of your flex items, or to always use the longhand form (rather than the shorthand) in flex declarations to avoid the gotchas shown in the table above. Demo 6.1.a shows how not setting any flexibility properties causes an error, and demo 6.2.a shows how using flex: 1 can have the same problem.

Flexbug #7

flex-basis doesn't account for box-sizing: border-box

Demos Browsers affected
7.1.abug
7.1.bworkaround
7.1.cworkaround
Internet Explorer 10-11 (fixed in Edge)

An explicit flex-basis value (i.e., any value other than auto) is supposed to act just like width or height. It determines the initial size of a flex item and then the other flexibility properties allow it to grow or shrink accordingly.

IE 10-11 always assume a content box model when using flex-basis to determine a flex item's size, even if that item is set to box-sizing: border-box. Demo 7.1.a shows that an item with a flex-basis value of 100% will overflow its container by the amount of its border plus its padding.

Workaround

There are two ways to work around this bug. The first requires no additional markup, but the second is slightly more flexible:

  1. Instead of setting an explicit flex-basis value, use auto, and then set an explicit width or height. Demo 7.1.b shows this.
  2. Use a wrapper element that contains no border or padding so it works with the content box model. Demo 7.1.c show this.

Flexbug #8

flex-basis doesn't support calc()

Demos Browsers affected
8.1.abug
8.1.bworkaround
Internet Explorer 10-11 (fixed in Edge)
8.2.abug
8.2.bworkaround
Internet Explorer 10 (fixed in 11)

IE 10-11 ignore calc() functions used in flex shorthand declarations. Demo 8.1.a shows flex: 0 0 calc(100%/3) not working in IE.

In IE 10, calc() functions don't even work in longhand flex-basis declarations (though this does work in IE 11). Demo 8.2.a shows flex-basis: calc(100%/3) not working in IE 10.

Workaround

Since this bug only affects the flex shorthand declaration in IE 11, an easy workaround (if you only need to support IE 11) is to always specify each flexibility property individually. Demo 8.1.b offers an example of this.

If you need to support IE 10 as well, then you'll need to fall back to setting width or height (depending on the container's flex-direction property). You can do this by setting a flex-basis value of auto, which will instruct the browser to use the element's main size property (i.e., its width or height). Demo 8.2.b offers an example of this.

Flexbug #9

Some HTML elements can't be flex containers

Demos Browsers affected Tracking bugs
9.1.abug
9.1.bworkaround
9.2.abug
9.2.bworkaround
9.3.abug
Chrome
Edge
Firefox (fixed in 63)
Opera
Safari (fixed in 11)
Chrome #375693 (fixed)
Chrome #700029 (fixed)
Edge #4511145 (obsolete)
Firefox #984869 (fixed)
Firefox #1230207 (fixed)
Firefox #1397768 (fixed)
Safari #169082 (fixed)
Safari #169700 (fixed)
Safari #190065 (fixed)

Certain HTML elements, like <summary>, <fieldset> and <button>, do not work as flex containers. The browser's default rendering of those element's UI conflicts with the display: flex declaration.

Demo 9.1.a shows how <button> elements didn't work in Firefox, and demo 9.2.a shows that <fieldset> elements don't work in most browsers. Demo 9.3.a shows that <summary> elements dont work in Safari.

Workaround

The simple solution to this problem is to use a wrapper element that can be a flex container (like a <div>) directly inside of the element that can't. Demos 9.1.b and 9.2.b show workaround for the <button> and <fieldset> elements, respectively.

Flexbug #10

align-items: baseline doesn't work with nested flex containers

Demos Browsers affected Tracking bugs
10.1.abug
10.1.bworkaround
Firefox (fixed in 52) Firefox #1146442 (fixed)

In Firefox, nested flex containers don't contribute to the baseline that other flex items should align themselves to. Demo 10.1.a shows the line on the left incorrectly aligning itself to the second line of text on the right. It should be aligned to the first line of text, which is the inner flex container.

Workaround

This bug only affects nested containers set to display: flex. If you set the nested container to display: inline-flex it works as expected. Note that when using inline-flex you will probably also need to set the width to 100%.

Flexbug #11

Min and max size declarations are ignored when wrapping flex items

Demos Browsers affected Tracking bugs
11.1.abug
11.1.bworkaround
Safari (fixed in 10.1) Safari #136041 (fixed)

Safari uses min/max width/height declarations for actually rendering the size of flex items, but it ignores those values when calculating how many items should be on a single line of a multi-line flex container. Instead, it simply uses the item's flex-basis value, or its width if the flex basis is set to auto.

This is problematic when using the flex: 1 shorthand because that sets the flex basis to 0%, and an infinite number of flex items could fit on a single line if the browser thinks their widths are all zero. Demo 11.1.a show an example of this happening.

This is also problematic when creating fluid layouts where you want your flex items to be no bigger than X but no smaller than Y. Since Safari ignores those values when determining how many items fit on a line, that strategy won't work.

Workaround

The only way to avoid this issue is to make sure to set the flex basis to a value that is always going to be between (inclusively) the min and max size declarations. If using either a min or a max size declaration, set the flex basis to whatever that value is, if you're using both a min and a max size declaration, set the flex basis to a value that is somewhere in that range. This sometimes requires using percentage values or media queries to cover all possible scenarios. Demo 11.1.b shows an example of setting the flex basis to the same value as the min width to workaround this bug in Safari.

Flexbug #12

Inline elements are not treated as flex-items

Demos Browsers affected
12.1.abug
12.1.bworkaround
Internet Explorer 10-11 (fixed in Edge)

Inline elements, including ::before and ::after pseudo-elements, are not treated as flex items in IE 10. IE 11 fixed this bug with regular inline element, but it still affects the ::before and ::after pseudo-elements.

Workaround

This issue can be avoided by adding a non-inline display value to the items, e.g. block, inline-block, flex, etc. Demo 12.1.b shows an example of this working in IE 10-11.

Flexbug #13

Importance is ignored on flex-basis when using flex shorthand

Demos Browsers affected
13.1.abug
13.1.bworkaround
Internet Explorer 10 (fixed in 11)

When applying !important to a flex shorthand declaration, IE 10 applies !important to the flex-grow and flex-shrink parts but not to the flex-basis part. Demo 13.1.a shows an example of a declaration with !important not overriding another declaration in IE 10.

Workaround

If you need the flex-basis part of your flex declaration to be !important and you have to support IE 10, make sure to include a flex-basis declaration separately. Demo 13.1.b shows an example of this working in IE 10.

Flexbug #14

Shrink-to-fit containers with flex-flow: column wrap do not contain their items

Demos Browsers affected Tracking Bugs
14.1.abug
14.1.bworkaround
14.1.cworkaround
Chrome (fixed in 118)
Firefox
Safari
Opera
Chrome #507397 (fixed)
Firefox #995020
Safari #157648

If you float a flex container, use inline-flex, or absolutely position it, the size of the container becomes determined by its content (a.k.a shrink-to-fit).

When using flex-flow: column wrap, some browsers do not properly size the container based on its content, and there is unwanted overflow. Demo 14.1.a shows an example of this.

Workaround

If your container has a fixed height (usually the case when you enable wrapping), you avoid this bug by using flex-flow: row wrap (note row instead of column) and fake the column behavior by updating the container's writing mode (and reseting it on the items). Demo 14.1.b shows an example of this working in all modern browsers.

Note: To use this workaround in Safari 10 you may need to set explicit dimensions on the flex items. Demo 14.1.c shows an example of how this can be needed in Safari 10.

Flexbug #15

Column flex items ignore margin: auto on the cross axis

Demos Browsers affected Tracking Bugs
15.1.abug
15.1.bworkaround
Internet Explorer 10-11 (fixed in Edge) IE #14593426

margin: auto can be used to fill all the available space between flex items (and is useful for centering), but in IE 10-11 this doesn't work in the cross axis for flex items within a column container.

Instead of filling the available space, items render according to their align-self property, which defaults to stretch. Demo 15.1.a shows an example of this.

Workaround

If you're using margin: auto to center items, you can achieve the same effect by setting align-self: center on each item with margin: auto (or align-items: center on the container). Demo 15.1.b shows this working in IE 10-11.

Flexbug #16

flex-basis cannot be animated

Demos Browsers affected Tracking Bugs
16.1.abug
16.1.bworkaround
Internet Explorer 10-11
Safari
Safari #180435 (fixed)

In some browsers, CSS animations involving the flex-basis property are ignored. Demo 16.1.a shows an example of this.

Workaround

Since the flex-basis property is effectively just a substitute for the container's size property along the main axis (width for rows and height for columns), you can achieve the effect of animating flex-basis by using a flex-basis value of auto and instead animating either the width or height instead. Demo 16.1.b shows how you can achieve the same effect from demo 16.1.a by animating width instead of flex-basis.

Flexbug #17

Flex items are not correctly justified when max-width is used

Demos Browsers affected
17.1.abug
17.1.bworkaround
Internet Explorer 11

In IE 11 the free space between or around flex items (as per their container's justify-content property) is not correctly calculated if a max-size property is used (max-width in the row direction, max-height in the column direction). Demo 17.1.a shows an example of this.

Workaround

In most cases where a max-size property is used on a flex item, the desired result is to have that item's initial size start at the value of the flex-basis property and grow to no larger than its max-size value.

In such cases, the same effect can be achieved by initially specifying the desired max-size as the item's flex-basis and then letting it shrink by setting the min-size property (min-width in the row direction, min-height in the column direction) to whatever flex-basis was previously set to.

In other words, the following two declarations will both render an item with a final size between 0% and 25% depending on the available free space:

.using-a-grow-strategy {
  flex: 1 0 0%;
  max-width: 25%;
}

.using-a-shrink-strategy {
  flex: 0 1 25%;
  min-width: 0%;
}

Demo 17.1.b shows this working in IE 11.

Acknowledgments

Flexbugs was created as a follow-up to the article Normalizing Cross-Browser Flexbox Bugs. It is maintained by @philwalton, @gregwhitworth and @akaustav. If you have any questions or would like to get involved, please feel free to reach out to one of us on Twitter.

Contributing

If you've discovered a flexbox bug and would like to submit a workaround for it, please open an issue or submit a pull request. Make sure to submit relevant test cases or screenshots and indicate which browsers are affected.

Please only submit bugs if they have a viable workaround and the workaround applies to most use cases. If you do not know of a workaround, but you're reasonably confident one exists, please indicate that in the issue and the community can help investigate.

Note: Do not submit bugs here in lieu of reporting them to browser vendors. Reporting bugs to browser vendors is the best and fastest way to get bugs fixed.

flexbugs's People

Contributors

akaustav avatar bloodyowl avatar chexpir avatar claudepache avatar cvrebert avatar fredrivett avatar gregwhitworth avatar henrik avatar hrgdavor avatar kittygiraudel avatar mattbrundage avatar mkurz avatar oliverjash avatar paulirish avatar philipstanislaus avatar philipwalton avatar roastchicken avatar silverwind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flexbugs's Issues

Firefox 36 scroll issue?

Having some issues with FF 36 and intrinsic container sizing. Not sure if this is a new bug in FF or even a bug at all.

I was looking at this SO item and jsfiddle that has Flex container that scrolls; it works fine in Chrome but not in Firefox.

http://stackoverflow.com/questions/20776491/inner-div-using-100-of-height-of-an-outer-div-thats-based-itself/20776611#20776611
http://jsfiddle.net/nu83c/6/

Also this example works in Chrome but not FF. I believe this used to work in FF but am not familiar enough with the Flexbox spec to describe what is broken.

http://stackoverflow.com/questions/25351810/scrollable-flexbox-list
http://jsfiddle.net/ch7n6/4/

Problem with animated sprites in flexbox

I'm developing a website using flexbox and want to use animated sprites on it. Flexbox doesn't like animated sprites and they throw flexbox's calculations out dramatically. There are two websites where the code is demonstrated: ieee-qld.org/flex-bad and ieee-qld.org/flex-good. On the first site the animated graphic is 75% bigger than it should be, spreading over two sprite frames.

In the code below I've commented out the flexbox-enabling code (ieee-qld.org/flex-good). Removing the comments causes the animated sprite to misbehave (ieee-qld.org/flex-bad).

<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>flex problem</title>
</head>
<body>
<style>
* {margin:0; padding:0; border:0; outline:0; vertical-align:baseline; background:transparent;}
body {line-height:1.5; font-size:75%; color:#222; background:#b6d3e4; font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
.sprite {width:150px; height:130px; border-width: 5px; border-style:solid; border-color:#ffffff; border-radius:5px; background-image:url("sprite.jpg");
    -webkit-animation: play 20s steps(4) infinite;
    -ms-animation: play 20s steps(4) infinite;
    animation: play 20s steps(4) infinite;}
@-webkit-keyframes play{from{background-position:0px;}to{background-position:-600px;}}
@-ms-keyframes play{from{background-position:0px;}to{background-position:-600px;}}
@keyframes play{from{background-position:0px;}to{background-position:-600px;}}

header {background:#4971a2; position:fixed; left:0px; top:18px; height:15%; width:100%; clear:both;}

/* ************** flexbox code commented out at ieee-qld.org/flex-good *************************
.box {flex:1;}
.box:nth-child(2){flex-grow:2;}
.flexy {display:flex;flex-direction:row;align-items:center;height:30px;background:yellow;}
* {-webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box;}
***************************************************** */
.c {text-align:center;}
.bold {font-weight:bold;}
.box {margin-left:4%; margin-right:4%;}
h1,h2,h3,h4,h5,h6 {font-weight:normal; color:#111;}
h1 {font-size:3em; line-height:1; margin-bottom:0.5em;}
</style>
  <header>
  <div class="flexy">
    <div class="box sprite"></div>
     <div class="box"><h1 class="c bold">IEEE Queensland Section</h1></div>
    <div class="box">clue</div>
  </div>
  </header>
 </body>
</html>

The sprite is attached below.

Workaround: Android 2.3 ignores justify-content: space-around

Not exactly a bug, more a limitation of the prior spec http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/ that Android 2.3 works against.

If you have a flex parent and set justify-content: space-around Android 2.3 will ignore the declaration entirely. This may result in non-optimal layout as all flex-children will justify to the flex-start. You may find it preferable to use both possible space-* declarations for justify-content. This will get you space-between in Android 2.3 and space-around in modern implementations which may be preferable depending upon your goals.

Working example: http://codepen.io/benfrain/pen/yymaOr

.wrapper {
    display: flex;
    flex: 1 1 60%;
    /* Android 2.3 understands the first declaration and ignores the second */
    justify-content: space-between;
    /* Modern browsers overwrite the first declaration with the second */   
    justify-content: space-around;
}

Various IE11 bugs

I haven't had a chance to debug the various ones on this site. They may be related to ones we already have addressed or new ones but I'm creating a placeholder to remind myself to look into them and provide work arounds.

Flex Items Grow too Wide with flex-direction:row


Top: Safari (correct) Bottom: Firefox (incorrect)

So in this codepen we have a flex parent (.eureka) with two children .pathbrowser (blue) and .stage (green).

The .stage is also a flex parent that uses flex-direction:column to lay it's two children (.topbar and .eureka-table) out vertically.

The .eureka-table contains a basic table that a has a tbody that uses overflow-x:auto for scrollbars with a bunch of content in it.

The concept of the layout is the blue sidebar on the left takes up a fixed amount of space while the stage takes up the rest. The stage should be able to overflow content without breaking the layout.

Currently In Firefox 38 and Edge nightly the content does not overflow correctly and the layout breaks.

This codepen forks the above codepen and makes one change (line 34) that sets .eureka {flex-direction:column}. This will make the blue sidebar layout incorrectly but notice the table content now overflows correctly.

Also see #42

Nested flexboxes: IE11 doesn't respect max-width: 100%

IE11 ignores max-width: 100% on a child element. In this example, the left iframe should only grow to the max width of the column (as it does in Chrome or FF).

I first reported this issue at stack overflow two months ago, please see the broader explanation there.

My workaround was to define the max-width in px with the usage of "calc( 100% - 0.1px )".

Is this probably linked to flexbug 1?

Chrome does not size children correctly on basic flex

I have a very basic example that contains a parent set to display: flex and two paragraph elements.

.flex {
    display: flex;
    width: 400px;
}

On Firefox and IE, these two paragraphs are appropriately sized and contained within the parent container. On Google Chrome, the first paragraph utilizes more space than necessary and makes the second paragraph overflow.

See the following simple example that works on IE/Firefox, but not Chrome.

Any ideas how to workaround this?

IE (11), padding on child elements

I've noticed a weird discrepancy between IE (11) and other Browsers when you apply padding to elements that are child elements of a display:flex container.

I've documented it on my blog here:http://michaelgunner.co.uk/padding-flexbox-child-elements-causing-chaos-ie/

To summarise, if you set a flex-basis value and use flex-wrap:wrap, when you add padding to the elements in IE the layout totally screws up.

It's quite possible that being January, and also recovering from a bad cold/xmas/ny, I'm missing a beat somewhere and pulling a bit of a noob move - but I can't figure it out.

Code link: http://codepen.io/brightonmike/pen/KwNLpo

I'm aware I could remove the wrap property - but I want to my elements to wrap, not squeeze onto one line. Using width instead of basis fixes it too, but that reduces the flexibility of the code.

Firefox 36 flex-basis `0%` in sized container

This example demonstrates the problem: http://codepen.io/anon/pen/xbmxjz

The button toggles between flex-basis: 0%; and flex-basis: 0px; on the element that has overflow content. In both Chrome 41 and Safari 8 toggling the class has no effect. In Firefox, the height of wrapper overflow: auto; element grows to the height of its content when the basis uses 0% instead of 0px.

This can probably be boiled down to an even smaller test case to put into a concise bug report. Seeing that Safari and Chrome have no problem and that 0% == 0px == 0 in all other CSS attributes this doesn't seem like correct behavior.

Chrome v44 flexbox height calculation change

Scroll bars created with overflow: auto disappeared in my web app when viewed in Chrome v44. They worked as designed in Chrome v43.

The workaround turned out to be adding a max-height: 75vh; to the overflow container. Additionally a background color should be applied to the overflow container to prevent the content from expanding outside of the parent container's background-color.

The fixed example uses some set height elements that needed to be further calculated. These examples show a slightly complex design.

Before the viewport height fix:
http://codepen.io/slwfleming/pen/aOWaqQ

Using the viewport height fix:
http://codepen.io/slwfleming/pen/VLbGvR

Firefox and nested/numerous flexboxes

Firefox has big problems with flexboxes where Internet Explorer and Chrome display them without issues.

See this link to test : http://codepen.io/anon/pen/dhzJE

The slider allows user to increase the number of flexboxes.

Under IE & Chrome : no latency while dragging the slider left and right, under FireFox, if you scroll too much to the right, Firefox crash… -.-"

Ps : thx philipwalton, flexbugs is a good idea

Margin: auto doesn't work on Android < 4.4

Another limitation of the early version of the spec: http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/

Unfortunately, auto margin doesn't seem to work. This is a lovely convenience of modern implementations as it lets you easily offset to one side. For example:

http://codepen.io/benfrain/pen/rVMydO

<div class="wrapper">
item in root
    <span>span</span>
</div>
.wrapper {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}
.wrapper span {
  margin-left: auto;
}

Instead you can workaround (in a fashion like this). Be aware that this requires Modernizr to provide the fork.

.wrapper {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  /* position relative only needed for positioning context for workaround */
  position: relative;
}
.wrapper span {
  margin-left: auto;
}

span {
  /* For devices that have legacy implementations (and not current flexbox)*/
}
.no-flexbox.flexboxlegacy span {
  position: absolute;
  right: 0;
  top: 50%;
  -webkit-transform: translateY(-50%);
      -ms-transform: translateY(-50%);
          transform: translateY(-50%);
}

IE bug

I've got a problem with flexbox on IE11. Using the following code I get three horizontal boxes of uneven size in all browsers. The middle box is slightly wider than the outside boxes, but all boxes are the same height.

Here's the code in full.

<!DOCTYPE html>
<html lang=en>
<head>
<meta charset="UTF-8" />
<meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
<meta name="keywords" content="IEEE, Queensland, Section" />
<meta name="description" content="official IEEE queensland Section website" />
<meta name="author" content="Mike Robinson" />
<title>IEEE Queensland Section</title>
</head>
<body onload="">

<style>
.ieee {
  display: flex;
  flex-direction: row;
  margin-right: .5cm;}

.box {
\*  flex: 1; *\
  margin: 1% 0 1% 1%;
  box-shadow: 0 0 10px #888888;
  background: #c5d4e9;
  padding: 10px 10px;
  font-size: 10.25pt;}

@media only screen and (max-width:680px) {.ieee {flex-direction: column;}}
</style>

  <section>
    <br />
    <div class="ieee">
      <div class="box">
        <h3>The IEEE</h3>
        <p>Founded in May 1884, the IEEE - with over 400,000 members world-wide - is the world's largest technical professional organisation dedicated to advancing technological innovation and excellence for the benefit of humanity.</p>
        <p>IEEE and its members inspire a global community through its publications, conferences, technology standards, and professional and educational activities.</p>
        <p>Membership of the Institute offers many rewards, including professional development, access to the latest technical publications, and the opportunity to network with like-minded professionals.</p>
      </div>
      <div class="box">
        <h3>IEEE Queensland Section</h3>
        <p>The IEEE Queensland Section was founded on February 22nd, 1985. It is situated in the Asia-Pacific region, known as IEEE <a href="http://www.ieeer10.org/" target="_blank">Region 10</a>. The section conducts local activities and provides services to IEEE members who live and work in the part of Queensland, Australia, below 23&deg; south.</p>
        <p>The section supports the activities of eight chapters of IEEE technical societies, as well as the Women in Engineering and Young Professional Program affinity groups.</p>
        <p>The section website informs members of the broad range of services and activities that are available, and chronicles the activities of the section's chapters, affinity groups, and members.</p>
      </div>
      <div class="box">
        <h3>IEEE Membership</h3>
        <p>Click <a href="http://www.ieee.org/membership_services/membership/join/index.html" target="_blank">here</a> if you would like information about becoming an IEEE member, and <a href="http://www.ieee.org/membership_services/membership/benefits/index.html" target="_blank">here</a> to review membership benefits.</p>
        <p>If you have been an IEEE member for several years you should consider elevating your membership to Senior Member grade. Click <a href="http://ewh.ieee.org/r10/queensland/v2/doku.php/upgrade">here</a> for detailed information on the different types of membership elevation that are available.</p>
        <p>Click <a href="http://www.ieee.org/membership_services/membership/renew/index.html" target="_blank">here</a> to renew your membership for <script>document.write (new Date().getFullYear());</script>.</p>
        <p>Please contact the Queensland <a href="mailto:[email protected]?Subject=Volunteering%20enquiry">Section Chair</a> if you are interested in serving on the section's executive committee, or volunteering in any other way.</p>
      </div>
    </div>
  </section>
</body>
</html>

Uncommenting flex: 1; in .box{...} fixes the unequal box size problem, but when I downsize the IE11 browser the three boxes are overlayed in a weird fashion. In all other downsized browsers the boxes are stacked vertically, which is the correct result.

Any suggestions?

ie11

Safari max-width issue on children in flex container

Just noticed an odd bug that I'm only seeing in Safari right now. When children of a parent container set to flex are given a fluid width and a static max-width, the max-width doesn't seem to override.

My solution for now is to just set the parent to text-align:center and the children to display:inline-block, but it seems odd that this works in Chrome, Safari and IE.

Submit tests.

For a longer-term view, it might be useful to submit the test cases you've constructed to the official test suite at https://github.com/w3c/csswg-test. That tends to encourage browser vendors to fix the issues, and ensures that any new implementations can benefit from your tests—apparently these particular cases were difficult to get right in existing implementations, so new implementations might be at risk of getting them wrong too.

Flex Items Grow too Tall with flex-direction:column

I've been working on a flexbox layout for a media browser and have run into what I believe to be a flexbox bug in Firefox. I've also noticed the same issue in Spartan.

TL;DR

I've created a codepen to show the issue. Have a look in Firefox 37 and see notes on lines 72 and 110 of the CSS source.

Screenshot


Safari (correct, top left), Firefox (incorrect, right), Spartan (incorrect, bottom left)

Description

With the box model the child affects the parent. With flexbox, the parent and siblings affect the child. Webkit seems to be the only engine to fully grasp this; or I’ve lost my mind. Could be that too.

Webkit and non-Webkit browsers seem to disagree on how to handle intrinsic container sizing on elements with a display:flex;flex-direction:column; parent. For example, if we have a look at the codepen in Firefox 37 and uncomment line 110 we see that our tbody, seen below in red, is the perfect size it should be:

It fills the remaining space just like we want. Isn't that lovely? Now if only it would stay that way! The concept of this "holy grail" layout is that the topbar and footer are always visible and our tbody content area uses overflow-y:auto to scroll it's innerContent if needed. The problem is non-Webkit browsers allow the tbody container to grow as tall as it's innerContent, rather than stay the size the flexbox spec says it should be. In other words, once you add enough content to your tbody rather than kicking in scrollbars the tbody will just keep getting taller, breaking the layout entirely.

Notice in the codepen everything from the body down to the tbody uses flexbox. I did this in an attempt to ensure to rid out any traditional box model layout rules that Firefox may apply but it was to no avail, it lets the parent grow unless we set an explicit height or max-height. This is not a solution because

  • the whole point of flexbox is to not need to do something like this
  • due to the nature of our layout being flexible we can't just use something like percentages
  • calc() doesn't work here either (see line 71)

See also

Possibly related to #8
Possibly related to #26
Possibly related to #41
Also see jpdevries/eureka#8

Bugs 2 and 4 also apply to Chrome

I had the same issue on:

  • Nexus 4, Android 5.0.1, Chrome 41.0.2272.96
  • Linux Ubuntu 14.04, Chrome 41.0.2272.101 (64-bit)
  • Linux Ubuntu 14.04, Chromium 41.0.2272.76 (64-bit)

Should I create a PR to add them?

Flexbox doesn't contain content in IE7

Description:
Just ran into this issue w/ flexbox, it's not containing the content like it does on other browsers. Here's an example:

screen shot 2015-05-21 at 15 08 30

Update: oops, took me awhile to realize that IE7 straight up does not support flexbox

Internet Explorer does not properly size nested flex children

In Internet Explorer, if a flex container has a child element that contains another flex container, this nested flex container's items do not attempt to size properly.

For example, if the child of the nested flex container is a paragraph element, then the paragraph text will not even attempt to wrap -- it will continue for as much text as there is. Below is an example of the markup necessary to notice this problem, assuming .flex { display: flex }.

<div class="outer flex">
    <div class="left">
        ...
    </div>
    <div class="right">
        <div class="some-other-content">...</div>
        <div class="inner flex">
            <p>...</p>
        </div>
    </div>
</div>

In the following example, the uppermost flex container has max-width: 400px. Despite this, the nested flex container's paragraph element stretches to 661 pixels on Internet Explorer 11. On Chrome and Firefox, the paragraph wraps properly (but on Chrome, we can see a separate issue as described in Issue #48).

If the nested flex container is an immediate child of the parent flex container, Internet Explorer appears to work properly.

http://jsfiddle.net/n6dtynq4/2/

However, this may not be an appropriate solution, as it we may not desire an immediate flex container within a flex container.

Chrome/Flexbox Intrinsic Sizing not implemented correctly

IE12 (Project Spartan) hasn't shipped yet so users haven't hit this in the wild but it would be good for us to have a work-around. They haven't implemented the update from the flex spec (which will be going to CR soon) regarding intrinsic sizing where you calculate the hypothetical main-size based on the cross-size taking the aspect ratio into account.

Animated sprite problem

This is related to issue #29 - Problem with animated sprites.

I'm redesigning http://ieee-qld.org to be responsive, using flexbox as the basis for the redesign. The original website shows how the sprite is supposed to work.

The code below better reflects the way I want to use animated sprites than the code in issue #29. The sprite is supposed to take up the first 150 pixels of the host flex item. Instead it occupies the entire width of the flex item, ie, 20% of the screen width. The rendering error appears in Win7 with Chrome, FF, Opera and IE11.

I have set up a demo of the problem at http://ieee-qld.org/sprite.

<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>flex problem</title>
</head>
<body>
 <style>
 * {margin:0; padding:0; border:0; outline:0; vertical-align:baseline;}
 body {line-height:1.5; font-size:75%; color:#222; background:#b6d3e4; font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
 .sprite {width:150px; height:140px; background-image:url("sprite.jpg");
     -webkit-animation: play 30s steps(6) infinite;
     animation: play 30s steps(6) infinite;}
 @-webkit-keyframes play{from{background-position:0px;}to{background-position:-900px;}}
 @keyframes play{from{background-position:0px;}to{background-position:-900px;}}
 header {display:flex;flex-direction:row;align-items:center; background:#4971a2; position:fixed; left:0px; top:18px; height:25%; width:100%;}
 .box {flex:1;}
 .box:nth-child(2){flex-grow:4;}
 .bold {font-weight:bold;}
 .c {text-align:center;}
 .w  {color:white;}
 h1,h2,h3,h4,h5,h6 {font-weight:normal; color:#111;}
 h1 {font-size:3em; line-height:1; margin-bottom:0.5em;}
</style>
<header>
    <div class="box sprite"></div>
    <div class="box"><h1 class="c bold">IEEE Queensland Section</h1></div>
    <div class="box">
       <img src="ieee_logo.png" width="142" height="44" alt="IEEE logo" />
       <p class="w"><br />IEEE is the world's largest<br />professional association for the<br />advancement of technology</p>
     </div>
 </header>
</body>
</html>

sprite

ieee_logo

[IE11] `flex-wrap: wrap-reverse` standard item-aligning inconsistent with other browser engines

When applying flex-wrap: wrap-reverse to a container that has align-items: flex-start set, all other tested browsers (Chrome 41, Firefox 38, Safari 8.0.3, Android 4.4) render the columns with an implicit align-items: flex-end. IE11 renders without this.

Testcase

Applying align-items: flex-end to the container via a scoped media query for IE (see Codepen) makes IE render the same as all other browsers.

Workaround

Bug Report

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.