UPDATE: I'm not convinced this is a duplicate question. While the implied minimum size of flex content might be causing the issue, I still am curious why I'm getting different results in Chrome and Firefox.
I'm working on a project with nested flexboxes, where one of the nested divs has overflowing content and should scroll. I have it working just as expected in Chrome and Safari, but both Firefox and Edge behave differently.
Here's the jsFiddle: https://jsfiddle.net/e3p6xk0L/4/
Also, here's the code / example inline
body {
padding: 0px;
margin: 0px;
}
div {
box-sizing: border-box;
}
.container {
display: flex;
flex-direction: column;
height: 100vh;
background: blue;
position: relative;
}
.top {
flex-basis: 40px;
background: purple;
}
.middle {
display: flex;
flex: 1;
background: orange;
}
.bottom {
flex-basis: 40px;
background: yellow;
}
.left {
flex-basis: 20px;
background: green;
}
.center {
flex: 1;
background: red;
}
.right {
flex-basis: 200px;
background: orange;
overflow-x: hidden;
overflow-y: auto;
padding: 10px;
}
.right-content {
height: 1000px;
background: gray;
}
<div class='container'>
<div class='top'>
</div>
<div class='middle'>
<div class='left'>
</div>
<div class='center'>
</div>
<div class='right'>
<div class='right-content'>
</div>
</div>
</div>
<div class='bottom'>
</div>
</div>
Basically, there should always be a purple bar of fixed height at the top, and a yellow bar of fixed height on the bottom. The gray content, which overflows the right div, should only cause that right div to scroll.
Does anyone see anything obvious that I'm doing incorrectly?