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

> (consider using a CodePen or similar, so you can just link directly to a testcase)

I was trying to make a simple test case, but I had no success, at least without understanding the issue.

>  I presume the flex container is fixed-height?

If you mean it has a fixed height, yeah it is.

> In that case, you'll get overflow no matter what, right? 

Not sure what you mean.

> The flexible element in the column needs to be scrollable, then; if it becomes scrollable, that should automatically solve your case as well, since its content-based minimum size is zero then.

When I added `overflow: auto` to the last element (after removing `height: 0`), that indeed also fixed it.

---

What I was expecting, and what I think most people would expect, is for the layout manager to specialize in one thing only: layout of its children without caring about grand children.

The most intuitive behavior would be for the children of the `display: flex` container to be laid out based only on the container-child relationship (flex properties on the container and the children), and the number of children, but not based on grandchildren.

It would be the same concept as if I had an element not inside a flex container, and I specified a certain `width` and `height` for it: the width and height would always dictate the size of the element, regardless of its children (they I can re-organize the children, or use `overflow`, etc).

If flexbox worked this way, then if the children of laid-out elements are too big, they would overflow, exactly like with explicit widths and heights, and one could re-organize the children or use `overflow` to clip or scroll them. This would be highly intuitive, and it makes me feel anguish that APIs are being designed to make things more difficult (it's nothing personal).

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


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

Received on Sunday, 23 May 2021 22:34:00 UTC