File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -489,22 +489,15 @@ export default {
489489 const element = this .$refs .scrollContainer
490490 if (! element) return
491491
492- function scrollToBottom () {
493- setTimeout (() => {
494- const options = { top: element .scrollHeight , behavior: ' smooth' }
495- element .scrollTo (options)
496- }, 50 )
497- }
498-
499492 if (oldVal && newVal && oldVal .length === newVal .length - 1 ) {
500493 this .newMessages = []
501494 this .loadingMessages = false
502495
503496 if (this .getBottomScroll (element) < 60 ) {
504- return scrollToBottom ()
497+ return this . scrollToBottom ()
505498 } else {
506499 if (newVal[newVal .length - 1 ].senderId === this .currentUserId ) {
507- return scrollToBottom ()
500+ return this . scrollToBottom ()
508501 } else {
509502 this .scrollIcon = true
510503 return this .scrollMessagesCount ++
@@ -850,8 +843,10 @@ export default {
850843 return scrollHeight - clientHeight - scrollTop
851844 },
852845 scrollToBottom () {
853- const element = this .$refs .scrollContainer
854- element .scrollTo ({ top: element .scrollHeight , behavior: ' smooth' })
846+ setTimeout (() => {
847+ const element = this .$refs .scrollContainer
848+ element .scrollTo ({ top: element .scrollHeight , behavior: ' smooth' })
849+ }, 50 )
855850 },
856851 onChangeInput () {
857852 this .keepKeyboardOpen = true
You can’t perform that action at this time.
0 commit comments