@@ -466,8 +466,7 @@ export default {
466
466
})
467
467
468
468
this .$refs [' roomTextarea' ].addEventListener (' blur' , () => {
469
- this .filteredUsersTag = []
470
- this .textareaCursorPosition = null
469
+ this .resetUsersTag ()
471
470
if (isMobile) setTimeout (() => (this .keepKeyboardOpen = false ), 0 )
472
471
})
473
472
@@ -587,7 +586,7 @@ export default {
587
586
588
587
methods: {
589
588
updateShowUsersTag () {
590
- if (this .$refs [' roomTextarea' ]) {
589
+ if (this .$refs [' roomTextarea' ] && this . room . users . length > 2 ) {
591
590
if (
592
591
this .textareaCursorPosition ===
593
592
this .$refs [' roomTextarea' ].selectionStart
@@ -621,10 +620,9 @@ export default {
621
620
' username' ,
622
621
query,
623
622
true
624
- )
623
+ ). filter ( user => user . _id !== this . currentUserId )
625
624
} else {
626
- this .filteredUsersTag = []
627
- this .textareaCursorPosition = null
625
+ this .resetUsersTag ()
628
626
}
629
627
}
630
628
},
@@ -635,6 +633,10 @@ export default {
635
633
user .username +
636
634
this .message .substr (cursorPosition + 1 )
637
635
},
636
+ resetUsersTag () {
637
+ this .filteredUsersTag = []
638
+ this .textareaCursorPosition = null
639
+ },
638
640
onImgLoad () {
639
641
let height = this .$refs .imageFile .height
640
642
if (height < 30 ) height = 30
@@ -727,6 +729,7 @@ export default {
727
729
return
728
730
}
729
731
732
+ this .resetUsersTag ()
730
733
this .resetTextareaSize ()
731
734
this .message = ' '
732
735
this .editedMessage = {}
0 commit comments