fix(chat): replace autocomplete at @

This commit is contained in:
Sabe Jones
2018-11-01 15:17:01 -05:00
parent eafa2f8cdd
commit b54f031acd
2 changed files with 7 additions and 5 deletions

View File

@@ -65,7 +65,7 @@ import tier9 from 'assets/svg/tier-staff.svg';
import tierNPC from 'assets/svg/tier-npc.svg';
export default {
props: ['selections', 'text', 'coords', 'chat', 'textbox'],
props: ['selections', 'text', 'caretPosition', 'coords', 'chat', 'textbox'],
data () {
return {
atRegex: new RegExp(/@[\w-]+$/),
@@ -142,7 +142,7 @@ export default {
if (!this.atRegex.test(newText)) return;
this.searchActive = true;
this.currentSearchPosition = newText.length - 2;
this.currentSearchPosition = newText.lastIndexOf('@', this.caretPosition);
},
chat () {
this.resetDefaults();