-
Notifications
You must be signed in to change notification settings - Fork 498
Flex Items Grow too Tall with flex-direction:column #42
Comments
Notes
|
Ok so I think I finally figured something out... it comes down to
I forked the above codepen here, which works in Spartan and Firefox. 🎉 I used Spartan and Firefox CSS hacks to set Lastly, I forked one more time with this pen and removed the CSS hacks and took advantage of the ability to use ConclusionIt's annoying that Project Spartan masks itself as webkit because as I've demonstrated it does not absolutely mimic it's behavior. I'm not sure which browser engine, if any, properly conform to the flexbox spec in this scenario but I think if you had to pick one it would be webkit :/ |
If you apply |
@philipwalton hm, i've forked the original pen, removed bourbon, added autoprefixer, and applied However notice in this pen, if I set |
hello, I ran into an issue which is similar to jpdevries's issue. Please see my question in stackoverflow. |
@rliuyi No one knows where to find your question in StackOverflow. |
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
![](https://camo.githubusercontent.com/0bde08c4bba39d61c8d83e16c98570318da82005d33a781354f0a7c9437b0aa6/687474703a2f2f6a34702e75732f696d6167652f3132316633453179334532522f53637265656e25323053686f74253230323031352d30352d30352532306174253230322e33362e3135253230504d2e706e67)
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 ourtbody
, 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 thetbody
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 yourtbody
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 thetbody
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 explicitheight
ormax-height
. This is not a solution becauseSee also
Possibly related to #8
Possibly related to #26
Possibly related to #41
Also see jpdevries/eureka#8
The text was updated successfully, but these errors were encountered: