mirror of https://github.com/zulip/zulip.git
typeahead: Remove highlight for suggestions with empty query.
Earlier in typeaheads, empty query suggestions would highlight all the available suggestions for person name and channel name. This commit changes the behaviour so that empty query doesn't give highlighted suggestions.
This commit is contained in:
parent
601125e1ca
commit
897852f130
|
@ -43,9 +43,9 @@ export function build_highlight_regex(query: string): RegExp {
|
|||
}
|
||||
|
||||
export function highlight_with_escaping_and_regex(regex: RegExp, item: string): string {
|
||||
// if regex is empty return entire item highlighted and escaped
|
||||
// if regex is empty return entire item escaped
|
||||
if (regex.source === "()") {
|
||||
return "<strong>" + Handlebars.Utils.escapeExpression(item) + "</strong>";
|
||||
return Handlebars.Utils.escapeExpression(item);
|
||||
}
|
||||
|
||||
// We need to assemble this manually (as opposed to doing 'join') because we need to
|
||||
|
|
Loading…
Reference in New Issue