I'm trying to create a 3-column layout where one of the columns scrolls as it overflows.
I have a working prototype here in this code sandbox.
It looks like this:
The teal/cyan color is the overflow scrolling section - and the topmost parent's padding is visible around the frame in gray.
The part that doesn't work - is that when I want to embed/nest this working flexbox within another flexbox that also contains a header - but when I do that, the contained scrolling of this one breaks - and the whole flexbox overflows off screen.
Codesandbox of version that doesn't work
Screenshot:
I guess there's something about flexbox sizing that I don't understand cause I have played around with different height/flex values and can't fix this.
What am I doing wrong?
P.S. I'm using Chakra-UI for components+styling - but the attributes are the same as vanilla CSS. I don't think that makes any difference to this problem. The markup is just more concise.