mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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
This commit is contained in:
committed by
Joram Wilander
parent
1d0303cfb5
commit
b05f82e231
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user