diff --git a/zephyr/static/js/typeahead_helper.js b/zephyr/static/js/typeahead_helper.js index 3ad318abee..3876c14d95 100644 --- a/zephyr/static/js/typeahead_helper.js +++ b/zephyr/static/js/typeahead_helper.js @@ -141,8 +141,12 @@ exports.sort_subjects = function (items) { }; exports.sort_recipients = function (matches) { - var name_results = prefix_sort(this.query, matches, identity); - var email_results = prefix_sort(this.query, name_results.rest, email_from_identity); + var query = this.query; + if (query[0] === '@') + query = query.substring(1); + + var name_results = prefix_sort(query, matches, identity); + var email_results = prefix_sort(query, name_results.rest, email_from_identity); var sorted_by_pms = exports.sort_by_pms(email_results.rest); return name_results.matches.concat(email_results.matches.concat(sorted_by_pms)); };