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
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
1d0303cfb5
Коммит
b05f82e231
@@ -112,7 +112,7 @@ export default class AtMentionProvider {
|
|||||||
handlePretextChanged(suggestionId, pretext) {
|
handlePretextChanged(suggestionId, pretext) {
|
||||||
clearTimeout(this.timeoutId);
|
clearTimeout(this.timeoutId);
|
||||||
|
|
||||||
const captured = (/@([a-z0-9\-\._]*)$/i).exec(pretext.toLowerCase());
|
const captured = (/(?:^|\W)@([a-z0-9\-\._]*)$/i).exec(pretext.toLowerCase());
|
||||||
if (captured) {
|
if (captured) {
|
||||||
const prefix = captured[1];
|
const prefix = captured[1];
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ export default class AtMentionProvider {
|
|||||||
AppDispatcher.handleServerAction({
|
AppDispatcher.handleServerAction({
|
||||||
type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
|
type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
|
||||||
id: suggestionId,
|
id: suggestionId,
|
||||||
matchedPretext: captured[0],
|
matchedPretext: `@${captured[1]}`,
|
||||||
terms: mentions,
|
terms: mentions,
|
||||||
items: users,
|
items: users,
|
||||||
component: AtMentionSuggestion
|
component: AtMentionSuggestion
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user