logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe
commit: 7887e42fca28f16859d2046c0f9085e6f48d77d5
parent: 9989ad29dfd5d026aa8532f4c7043462bfcd77ab
Author: kaniini <nenolod@gmail.com>
Date:   Thu, 13 Sep 2018 19:30:28 +0000

Merge branch 'fixAutocomplete' into 'develop'

Fixes broken autocomplete for users

See merge request pleroma/pleroma-fe!344

Diffstat:

Msrc/components/post_status_form/post_status_form.js7+++++--
1 file 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 @@ -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 }