Match users using startsWith instead of match.

This commit is contained in:
scarlett 2018-08-26 13:51:21 +01:00
parent b68ebf3056
commit 74a6df8a55

View file

@ -75,7 +75,7 @@ const PostStatusForm = {
const firstchar = this.textAtCaret.charAt(0)
if (firstchar === '@') {
const matchedUsers = filter(this.users, (user) => (String(user.name + user.screen_name)).toUpperCase()
.match(this.textAtCaret.slice(1).toUpperCase()))
.startsWith(this.textAtCaret.slice(1).toUpperCase()))
if (matchedUsers.length <= 0) {
return false
}