diff options
author | Thomas Hopkins <thomchop@users.noreply.github.com> | 2016-11-02 03:47:12 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-11-02 06:47:11 -0400 |
commit | b05f82e2310284165d4bdcbde729be0c3fff34b0 (patch) | |
tree | 033eeb315eb162aed7024172cd417560a3c9dfde /webapp/components/suggestion/at_mention_provider.jsx | |
parent | 1d0303cfb5a16c5b8ef302ab623e9452db3f3cc8 (diff) | |
download | chat-b05f82e2310284165d4bdcbde729be0c3fff34b0.tar.gz chat-b05f82e2310284165d4bdcbde729be0c3fff34b0.tar.bz2 chat-b05f82e2310284165d4bdcbde729be0c3fff34b0.zip |
PLT-4098 Don't show @mention suggestions if word chars immediately precede at sign (#4399)
* PLT-4098 Don't show @mention suggestions if word chars immediately precede at sign
* PLT-4098 Simplify detection of word chars preceding @mentions
Diffstat (limited to 'webapp/components/suggestion/at_mention_provider.jsx')
-rw-r--r-- | webapp/components/suggestion/at_mention_provider.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/webapp/components/suggestion/at_mention_provider.jsx b/webapp/components/suggestion/at_mention_provider.jsx index d4f441f98..d1a03deb5 100644 --- a/webapp/components/suggestion/at_mention_provider.jsx +++ b/webapp/components/suggestion/at_mention_provider.jsx @@ -112,7 +112,7 @@ export default class AtMentionProvider { handlePretextChanged(suggestionId, pretext) { clearTimeout(this.timeoutId); - const captured = (/@([a-z0-9\-\._]*)$/i).exec(pretext.toLowerCase()); + const captured = (/(?:^|\W)@([a-z0-9\-\._]*)$/i).exec(pretext.toLowerCase()); if (captured) { const prefix = captured[1]; @@ -146,7 +146,7 @@ export default class AtMentionProvider { AppDispatcher.handleServerAction({ type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS, id: suggestionId, - matchedPretext: captured[0], + matchedPretext: `@${captured[1]}`, terms: mentions, items: users, component: AtMentionSuggestion |