Is there a way to use CSS to ensure that the scroll bar of a fixed-height message box is always at the bottom, displaying the latest entry?
Currently, as more messages populate the chat box main section, everything inside remains static. The only way to view the most recent message is to manually scroll up. How can this be automated to scroll up automatically?
<div class="chat-box-main">
{{#each messages}}
<div class="message-box">{{text}}</div>
{{/each}}
</div>
CSS:
.chat-box-main {
height:250px;
overflow:auto;
}
I am using Meteor and have a function running when the template is created. Since all divs are inserted reactively within my helper function, I am trying to find a way to make this computation run every time a new div is added within the scrolling div.