Flexbox column-reverse in Firefox, Edge and IE
This is a bug in Firefox, Edge and IE11.
With flex-direction: column-reverse
the scroll bar appears only in Chrome.
If you switch to column
the scroll bar works on all browsers.
More information:
Bug 1042151 - flex-direction: column-reverse (or "flex-direction:column; justify-content:flex-end") with overflow-y: auto is not scrollable
Philip Walton / flexbugs - Column-reverse and overflow-y not scrollable
As a workaround, you can distribute the styles of your container among two different containers:
- The outer one with the sizes, borders and overflow
- The inner one with the flexbox styles
If you want it to be scrolled to the bottom by default, you can use JS: Scroll to bottom of div?
function scrollToBottom(el) { el.scrollTop = el.scrollHeight; }
scrollToBottom(document.getElementById('list'));
#list {
height: 250px;
overflow-y: scroll;
border: 1px solid black;
}
#inner-list {
display: flex;
flex-direction: column-reverse;
}
.item {
flex: 1;
padding: 2em;
border: 1px dashed green;
}
<div id="list">
<div id="inner-list">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
</div>
</div>