@@ -274,7 +274,6 @@ export default {
274
274
filteredUsersTag: [],
275
275
selectedUsersTag: [],
276
276
filteredTemplatesText: [],
277
- textareaCursorPosition: null ,
278
277
recorder: this .initRecorder (),
279
278
isRecording: false
280
279
}
@@ -661,15 +660,9 @@ export default {
661
660
return
662
661
}
663
662
664
- if (
665
- this.textareaCursorPosition === this.getTextareaRef().selectionStart
666
- ) {
667
- return
668
- }
663
+ const textareaCursorPosition = this.getTextareaRef().selectionStart
669
664
670
- this.textareaCursorPosition = this.getTextareaRef().selectionStart
671
-
672
- let position = this.textareaCursorPosition
665
+ let position = textareaCursorPosition
673
666
674
667
while (
675
668
position > 0 &&
@@ -687,10 +680,7 @@ export default {
687
680
this.message.charAt(position - 1) === tagChar &&
688
681
(!beforeTag || beforeTag === ' ' || notLetterNumber)
689
682
) {
690
- const query = this.message.substring(
691
- position,
692
- this.textareaCursorPosition
693
- )
683
+ const query = this.message.substring(position, textareaCursorPosition)
694
684
if (tagChar === ':') {
695
685
this.updateEmojis(query)
696
686
} else if (tagChar === '@') {
@@ -774,8 +764,6 @@ export default {
774
764
this.filteredUsersTag = []
775
765
this.filteredTemplatesText = []
776
766
}
777
-
778
- this.textareaCursorPosition = null
779
767
},
780
768
resetMessage(disableMobileFocus = false, initRoom = false) {
781
769
if (!initRoom) {
0 commit comments