I have this flex item expanding its height beyond its flex container if font-size is bigger.
.jobTitleDescCont {
display: flex;
flex-flow: column nowrap;
height: 100%;
border: yellowgreen solid 5px;
}
.jobTitleDescCont .jobTitle {
font-size: 1em;
height: 30%;
border: blue 5px solid;
}
.jobTitleDescCont .jobDesc {
font-size: 2em;
height: 70%;
border: green 5px solid;
overflow: auto;
}
<div class="jobTitleDescCont">
<div class="jobTitle">
{{job.title}}
</div>
<div class="jobDesc">
{{job.description}}
</div>
</div>
Here, .jobTitleDescCont .jobDesc
font-size: 1em;
and it works alright, overflow would work as expected without increasing its height, it's still within its container.
But when you .jobTitleDescCont .jobDesc
font-size: 2em;
, the flex container also increases and as a result, the flex item too.
Notice here in the lower right corner, the green and the yellowgreen border of the expanding flex item and the flex container is increasing. Of course, the scroll bar can go beyond that too and if the text is long enough, you can scroll beyond the visible part of the scrollbar until you can no longer see the scrollbar.
As per my understanding, the height of the flex container should remain 100% relative to it's container so as the flex item. I also know that flex items are responsive so they can get bigger depending on the content but I have the overflow to take care of the content.
Shouldn't just the overflow scrollbar just get longer as it accomodates bigger font text?
Why is it increasing the height of the flex container and item?
A temporary fix I have is setting height: 575px
.jobTitleDescCont {
display: flex;
flex-flow: column nowrap;
height: 575px;
border: yellowgreen solid 5px;
}
but this defeats the responsive CSS.