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 {
489
489
const element = this .$refs .scrollContainer
490
490
if (! element) return
491
491
492
- function scrollToBottom () {
493
- setTimeout (() => {
494
- const options = { top: element .scrollHeight , behavior: ' smooth' }
495
- element .scrollTo (options)
496
- }, 50 )
497
- }
498
-
499
492
if (oldVal && newVal && oldVal .length === newVal .length - 1 ) {
500
493
this .newMessages = []
501
494
this .loadingMessages = false
502
495
503
496
if (this .getBottomScroll (element) < 60 ) {
504
- return scrollToBottom ()
497
+ return this . scrollToBottom ()
505
498
} else {
506
499
if (newVal[newVal .length - 1 ].senderId === this .currentUserId ) {
507
- return scrollToBottom ()
500
+ return this . scrollToBottom ()
508
501
} else {
509
502
this .scrollIcon = true
510
503
return this .scrollMessagesCount ++
@@ -850,8 +843,10 @@ export default {
850
843
return scrollHeight - clientHeight - scrollTop
851
844
},
852
845
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 )
855
850
},
856
851
onChangeInput () {
857
852
this .keepKeyboardOpen = true
You can’t perform that action at this time.
0 commit comments