Hey all,
Hope everyone is good and still safe....
I have a small issue I can't figure out. I want upon clicking an accordion it expands and shows a chat log.
Code for this is as follows:
<div class="panel-body chat-panel border border-light border-bottom-0">
<ul class="list-unstyled">
<li class="media" v-for="(conversation,index) in group.messages" :key="index" :class="`collapse-${group.id}`">
<i class="far fa-user mr-3 img-thumbnail"></i>
<div class="media-body" ref="chat">
<h5 class="mt-0 mb-1">
{{ conversation.user.name }}
</h5>
<p>
{{ conversation.message }}<br />
<small class="text-muted pt-1">{{ human(conversation.updated_at) }}</small>
</p>
</div>
</li>
</ul>
</div>
This has a set height on the chat-panel class so upon the user clicking to show this I want the list to scroll to the bottom where the latest message is displayed.
I have tried the following:
this.$refs.chat.scrollIntoView();
// Which the ref is on
<div class="media-body" ref="chat">
But it fails to scroll, what am I missing or doing wrong?