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
1 changed files with 1 additions and 1 deletions

View File

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