From 5b1467a4c992d62a42fdec8b5743c07705e7c4f1 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 15 Aug 2017 14:08:26 +0100 Subject: [PATCH] Allow autocompletion when typing user IDs Because we need to support tab completing `"@some_user"` if `@some_user` has a display name that is totally different and will therefore not match what the user typed in. This does have the disadvantage of a display name appearing (the pill) that isn't at all what the user typed in, but the autocomplete box and the tooltip should give enough information to let the user know what's going on. (e.g. typing `@kyr*tab*` and getting `Remmy`). This _does_ run contrary to vector-im/riot-web#4495 related to vector-im/riot-web#4794 cc @lampholder --- src/autocomplete/UserProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autocomplete/UserProvider.js b/src/autocomplete/UserProvider.js index 69b80dade4..017491a07e 100644 --- a/src/autocomplete/UserProvider.js +++ b/src/autocomplete/UserProvider.js @@ -40,7 +40,7 @@ export default class UserProvider extends AutocompleteProvider { keys: ['name'], }); this.matcher = new FuzzyMatcher([], { - keys: ['name'], + keys: ['name', 'userId'], shouldMatchPrefix: true, }); }