aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2018-09-12 11:46:02 +0300
committerHenry Jameson <me@hjkos.com>2018-09-12 11:46:02 +0300
commit89f9b3a4686b50c5a99cbb1acba57f70b651786d (patch)
tree79f0e59570afa763e8dcf222d175145bc851455f
parent4bff6f12eda636c0df907070f9fac243e9abe30e (diff)
fixed autocomplete
-rw-r--r--src/components/post_status_form/post_status_form.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index d7f1ffb2..7babe236 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -75,8 +75,11 @@ const PostStatusForm = {
candidates () {
const firstchar = this.textAtCaret.charAt(0)
if (firstchar === '@') {
- const matchedUsers = filter(this.users, (user) => (String(user.name + user.screen_name)).toUpperCase()
- .startsWith(this.textAtCaret.slice(1).toUpperCase()))
+ const query = this.textAtCaret.slice(1).toUpperCase()
+ const matchedUsers = filter(this.users, (user) => {
+ return user.screen_name.toUpperCase().startsWith(query) ||
+ user.name && user.name.toUpperCase().startsWith(query)
+ })
if (matchedUsers.length <= 0) {
return false
}