Don't autocomplete users for single "@"
This commit is contained in:
parent
44bc60105a
commit
a3c407992b
1 changed files with 7 additions and 2 deletions
|
@ -101,8 +101,13 @@ export default class UserProvider extends AutocompleteProvider {
|
||||||
|
|
||||||
let completions = [];
|
let completions = [];
|
||||||
const {command, range} = this.getCurrentCommand(query, selection, force);
|
const {command, range} = this.getCurrentCommand(query, selection, force);
|
||||||
if (command) {
|
|
||||||
completions = this.matcher.match(command[0]).map((user) => {
|
if (!command) return completions;
|
||||||
|
|
||||||
|
const fullMatch = command[0];
|
||||||
|
// Don't search if the query is a single "@"
|
||||||
|
if (fullMatch && fullMatch !== '@') {
|
||||||
|
completions = this.matcher.match(fullMatch).map((user) => {
|
||||||
const displayName = (user.name || user.userId || '').replace(' (IRC)', ''); // FIXME when groups are done
|
const displayName = (user.name || user.userId || '').replace(' (IRC)', ''); // FIXME when groups are done
|
||||||
return {
|
return {
|
||||||
// Length of completion should equal length of text in decorator. draft-js
|
// Length of completion should equal length of text in decorator. draft-js
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue