File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -611,11 +611,11 @@ export default {
611
611
this .resetFooterList ()
612
612
}
613
613
},
614
- getCharPosition () {
614
+ getCharPosition (tagChar ) {
615
615
const cursorPosition = this .$refs [' roomTextarea' ].selectionStart
616
616
617
617
let position = cursorPosition
618
- while (position > 0 && this .message .charAt (position - 1 ) !== ' @ ' ) {
618
+ while (position > 0 && this .message .charAt (position - 1 ) !== tagChar ) {
619
619
position--
620
620
}
621
621
@@ -638,7 +638,7 @@ export default {
638
638
this .filteredEmojis = matchingKeys .map (key => this .emojisList [key])
639
639
},
640
640
selectEmoji (emoji ) {
641
- const { position , endPosition } = this .getCharPosition ()
641
+ const { position , endPosition } = this .getCharPosition (' : ' )
642
642
643
643
this .message =
644
644
this .message .substr (0 , position - 1 ) +
@@ -656,7 +656,7 @@ export default {
656
656
).filter (user => user ._id !== this .currentUserId )
657
657
},
658
658
selectUserTag (user ) {
659
- const { position , endPosition } = this .getCharPosition ()
659
+ const { position , endPosition } = this .getCharPosition (' @ ' )
660
660
661
661
const space = this .message .substr (endPosition, endPosition).length
662
662
? ' '
You can’t perform that action at this time.
0 commit comments