Skip to content

Commit 2de2f77

Browse files
committed
(fix) remove cursor position check
1 parent 2b0bafc commit 2de2f77

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/lib/Room/RoomFooter/RoomFooter.vue

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ export default {
274274
filteredUsersTag: [],
275275
selectedUsersTag: [],
276276
filteredTemplatesText: [],
277-
textareaCursorPosition: null,
278277
recorder: this.initRecorder(),
279278
isRecording: false
280279
}
@@ -661,15 +660,9 @@ export default {
661660
return
662661
}
663662
664-
if (
665-
this.textareaCursorPosition === this.getTextareaRef().selectionStart
666-
) {
667-
return
668-
}
663+
const textareaCursorPosition = this.getTextareaRef().selectionStart
669664
670-
this.textareaCursorPosition = this.getTextareaRef().selectionStart
671-
672-
let position = this.textareaCursorPosition
665+
let position = textareaCursorPosition
673666
674667
while (
675668
position > 0 &&
@@ -687,10 +680,7 @@ export default {
687680
this.message.charAt(position - 1) === tagChar &&
688681
(!beforeTag || beforeTag === ' ' || notLetterNumber)
689682
) {
690-
const query = this.message.substring(
691-
position,
692-
this.textareaCursorPosition
693-
)
683+
const query = this.message.substring(position, textareaCursorPosition)
694684
if (tagChar === ':') {
695685
this.updateEmojis(query)
696686
} else if (tagChar === '@') {
@@ -774,8 +764,6 @@ export default {
774764
this.filteredUsersTag = []
775765
this.filteredTemplatesText = []
776766
}
777-
778-
this.textareaCursorPosition = null
779767
},
780768
resetMessage(disableMobileFocus = false, initRoom = false) {
781769
if (!initRoom) {

0 commit comments

Comments
 (0)