Added chatscroll check (#9814)

This commit is contained in:
Keith Holliday
2018-01-20 17:00:54 -07:00
committed by GitHub
parent 2ba327ef14
commit 1ce09aeb34

View File

@@ -284,6 +284,7 @@ export default {
this.$set(this, 'activeChat', activeChat); this.$set(this, 'activeChat', activeChat);
Vue.nextTick(() => { Vue.nextTick(() => {
if (!this.$refs.chatscroll) return;
let chatscroll = this.$refs.chatscroll.$el; let chatscroll = this.$refs.chatscroll.$el;
chatscroll.scrollTop = chatscroll.scrollHeight; chatscroll.scrollTop = chatscroll.scrollHeight;
}); });
@@ -315,6 +316,7 @@ export default {
this.newMessage = ''; this.newMessage = '';
Vue.nextTick(() => { Vue.nextTick(() => {
if (!this.$refs.chatscroll) return;
let chatscroll = this.$refs.chatscroll.$el; let chatscroll = this.$refs.chatscroll.$el;
chatscroll.scrollTop = chatscroll.scrollHeight; chatscroll.scrollTop = chatscroll.scrollHeight;
}); });