MM-17135 ignore at sign when searching for users (#5491)
This commit is contained in:
parent
4489906698
commit
15a311fcec
2 changed files with 11 additions and 2 deletions
|
|
@ -120,7 +120,11 @@ class FilteredList extends Component {
|
|||
return channels;
|
||||
}
|
||||
|
||||
const text = term.toLowerCase();
|
||||
let text = term.toLowerCase();
|
||||
if (text.startsWith('@')) {
|
||||
text = text.substring(1);
|
||||
}
|
||||
|
||||
return channels.filter((c) => {
|
||||
const fieldsToCheck = ['display_name', 'username', 'email', 'full_name', 'nickname'];
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,12 @@ export const getMatchTermForAtMention = (() => {
|
|||
return (value, isSearch) => {
|
||||
if (value !== lastValue || isSearch !== lastIsSearch) {
|
||||
const regex = isSearch ? Autocomplete.AT_MENTION_SEARCH_REGEX : Autocomplete.AT_MENTION_REGEX;
|
||||
const match = value.match(regex);
|
||||
let term = value;
|
||||
if (term.startsWith('from: @') || term.startsWith('from:@')) {
|
||||
term = term.replace('@', '');
|
||||
}
|
||||
|
||||
const match = term.match(regex);
|
||||
lastValue = value;
|
||||
lastIsSearch = isSearch;
|
||||
if (match) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue