New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 606186 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 341310
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

FlexBox sizing broken

Reported by perec...@gmail.com, Apr 24 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0

Example URL:

Steps to reproduce the problem:
1. Have a FlexBox container with "flex-direction: row;" or "flex-direction: column;" and "display: flex;"
2. Have two or more child items with "flex: 1;"

What is the expected behavior?
All child flex items should be proportionally sized and not depend on their content for sizing.So if two flex items are set to "flex: 1;", they should each size to 50%. If there are three flex items with "flex: 1;", they should each be 33.3%. If there are two, one with "flex: 1;" and one with "flex: 2;", then one should be 33.3% and the other 66.6% respectively. Instead the size varies on the content they each contain rather than the defined CSS.

What went wrong?
Sizing changes based on content of flexbox items rather than given "flex: x" CSS proportions.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? Yes 

Chrome version: 50.0.2661.87  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 21.0 r0

When using CSS "Flex: #" to specify proportionality, Chrome doesn't respect the given sizes of the flex items. Instead it uses its contents to determine size.
 
Cc: ashej...@chromium.org
Labels: Needs-Feedback
Thanks for the report. would you mind providing us with sample jsbin/jsfiddle link which reproduces the above behavior ?

I really appreciate your help.

Thank you!
Components: -Blink Blink>Layout>Flexbox
Yes, please provide a testcase. Also, try using "min-width: 0; min-height: 0;" and see if that makes a difference.

This could also be related to bug 240765

Comment 4 by perec...@gmail.com, Apr 26 2016

Yes I did try "min-width: 0; min-height: 0;" and does not fix it. I will have a sample shortly.

Comment 5 by perec...@gmail.com, Apr 26 2016

The problem does not exhibit in neither jsbin nor jsfiddle. I have attached an html page you can try out. 

All boxes should be the same size. Instead you will see them in all different sizes based on their content. You can test with Firefox, Safari, IE11, Edge, etc. They all render the same thing - all boxes equal size. Only Chrome fails to do this.
sample.zip
1.5 KB Download
Project Member

Comment 6 by sheriffbot@chromium.org, Apr 26 2016

Labels: -Needs-Feedback Needs-Review
Owner: ashej...@chromium.org
Thank you for providing more feedback. Adding requester "ashejole@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Attaching the testcase from comment 5 directly
default.htm
5.8 KB View Download
Mergedinto: 341310
Status: Duplicate (was: Unconfirmed)
This works on dev. It's probably due to the fix for percentages in children of flex items -- the 0% flex-basis is now considered definite.

Yep, confirmed by bisect -- https://chromium.googlesource.com/chromium/src/+/0c12856b59827e462642d3ed8ce2d7042bcf7218

pereclix, this will be fixed in Chrome 51, but you also have a few options for solving this issue in Chrome 50. You can specify flex-basis: 0; in your .FlexItemAuto declaration (do this after your flex: 1;). You can also specify an explicit height: 100%; on .FlexContVert. Those two are probably your best options.

Note that instead of specifying flex: 1 and flex-shrink (and now flex-basis) separately you can just say: 
    flex: 1 100000 0;


Comment 9 by perec...@gmail.com, Apr 26 2016

Setting any element to 100% height down stream of any parents using flexbox will not work and in fact points out another long standing Chrome bug that breaks with all other browsers. See attached demo. I have been struggling with this one for years but at least I have an ugly javascript + shim workaround for this. It would be nice if this bug would be fixed too.
sample2.zip
1.5 KB Download
Yes, that bug is also fixed in Chrome 51, think that's also  bug 341310 . You can verify by downloading Chrome Canary or using the beta or dev channel.

Again, you can use the flex-basis suggestion instead if you want (at least in the specific testcase you provided)

Comment 11 by perec...@gmail.com, Apr 26 2016

Yes flex-basis: 0; does solve the issue until 51 release. Thanks.

When will v51 be released?
In about 5-6 weeks, give or take.
Labels: -Needs-Review

Sign in to add a comment