Merge pull request #1276 from matrix-org/luke/fix-rte-completion-raw-disp-name

Use the rawDisplayName for the user provider completion
pull/21833/head
David Baker 2017-08-08 10:38:24 +01:00 committed by GitHub
commit 3639fc0c3c
1 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,9 @@ export default class UserProvider extends AutocompleteProvider {
completions = this.matcher.match(command[0]).map((user) => { completions = this.matcher.match(command[0]).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 {
completion: displayName, // Length of completion should equal length of text in decorator. draft-js
// relies on the length of the entity === length of the text in the decoration.
completion: user.rawDisplayName,
suffix: range.start === 0 ? ': ' : ' ', suffix: range.start === 0 ? ': ' : ' ',
href: 'https://matrix.to/#/' + user.userId, href: 'https://matrix.to/#/' + user.userId,
component: ( component: (