I basically have pretty standard two-column layout:
<div id="app">
<div class="left">
<div class="first">
<div class="header">Dynamic Items</div>
<div class="scrollable">
<div id="items">
<div class="item">Predefined</div>
</div>
</div>
</div>
<div class="second">
<div class="header">Fixed Items</div>
<div class="items">
<div class="item">Fixed Item 1</div>
<div class="item">Fixed Item 2</div>
<div class="item">Fixed Item 3</div>
</div>
</div>
</div>
<div class="right">
<button id="btn">Add 5 Items</button>
</div>
</div>
It works almost as expected: when I add item to "Dynamic Items > items" container it stretches as expected until left column takes 100% of page height. Adding additional items makes "scrollable" .first
container.
.left {
display: flex;
flex-direction: column;
}
.first {
overflow: auto;
}
But, what I'm trying to achieve is to make only .scrollable
part to scroll, keeping .header
of the .first
container in place.
Please advise how to achieve such behavior.
Please take a look at this fiddle example: https://jsfiddle.net/Alexey_U/scf4mn86/39/