Autocomplete fixes and improvements

This commit is contained in:
Aviral Dasgupta 2016-09-13 17:29:17 +05:30
parent fbf2d5f96c
commit 9a991a4dfd
4 changed files with 32 additions and 21 deletions

View file

@ -28,9 +28,15 @@ export default class UserProvider extends AutocompleteProvider {
if (command) {
this.fuse.set(this.users);
completions = this.fuse.search(command[0]).map(user => {
const displayName = (user.name || user.userId || '').replace(' (IRC)', ''); // FIXME when groups are done
let displayName = (user.name || user.userId || '').replace(' (IRC)', ''); // FIXME when groups are done
let completion = displayName;
if (range.start === 0) {
completion += ': ';
} else {
completion += ' ';
}
return {
completion: user.userId,
completion,
component: (
<PillCompletion
initialComponent={<MemberAvatar member={user} width={24} height={24}/>}