In my flex container, I am attempting to create another flex container that will scroll content if it exceeds the screen size. Here is the code I have so far:
<Box
sx={{
m: 'var(--Content-margin)',
p: 'var(--Content-padding)',
width: 'var(--Content-width)',
flex: 1,
display: 'flex',
flexDirection: 'column',
backgroundColor: 'green',
}}
>
<Box sx={{ flex: 1, overflow: 'scroll', backgroundColor: 'orange' }}>
... // long list of content
</Box>
</Box>
I have experimented with different options, but I have been unable to prevent the default browser scrolling behavior. The content continues to grow downward instead of being contained within the orange box.
Currently, the layout looks like this. The scrolling appears at the browser level rather than within the orange box: