Re: [csswg-drafts] [css-flexbox] Vertical content overflows flex column layout unexpectedly, confusing (#6260)

>> In that case, you'll get overflow no matter what, right?
>
> Not sure what you mean.

I mean that if the flexbox is fixed height, and its children are taller than it, then you'll get overflow. Exactly which element is overflowing depends on various details, but *something* will overflow no matter what.

In this case, due to the way `min-height:auto` works on flex items, the flex item overflowed the flex container (but the flex item's content did not overflow the flex item).  This ends up being similar to what would happen in an ordinary `display:block` container.

If you set `min-height:0` on the flex items, the flex items will no longer overflow the container, but the flex item's content will overflow the flex item. (If you instead make it scrollable, nothing will overflow, but you'll get a scrollbar on the flex item.) 

We chose to set up the `min-height:auto` rules the way they are because, in our experience and considering a wide range of cases, it was better for users and less confusing to debug overall to have the flex items be the correct size for the content and potentially overflow the flex container, rather than always fitting the flex container and having their contents visibly overflow.

As I said, there's no *great* solution; anything we did here would result in some cases being confusing. We believe the route we chose results in less confusion overall, and an easier time identifying where in the layout you need to tweak something to get it how you intend. You might disagree; this is a value judgement with no right answer. Regardless, this is how Flexbox works and this aspect can't be changed at this point.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6260#issuecomment-858829549 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 10 June 2021 17:43:41 UTC