Whenever a new message is received or sent in the chat, I want the chat to automatically scroll down. I currently have a watcher set up in Vuex that updates a random value and monitors changes within the chat component:
watch: {
scrollChatDown: function (val) {
if (this.$refs.chat !== undefined) {
this.$refs.chat.scrollTop = 9999999999999999999999
console.log('It's working!')
}
}
}
Although I see the 'WORKING!' message in Mozilla, the scrollTop
feature doesn't seem to be functioning properly. Is there an alternative solution for achieving the same effect? :D