mirror of https://github.com/zulip/zulip.git
composebox_typeahead.js: Add typeahead cancelling for '# '.
If somebody types '# ', then close the typeahead dialog and don't autocomplete. Relevant node tests were also added. Fixes #4505.
This commit is contained in:
parent
60225012e6
commit
0d9b77c8b7
|
@ -59,6 +59,8 @@ global.people.add({
|
|||
assert_typeahead_equals("test @", false);
|
||||
assert_typeahead_equals("test no@o", false);
|
||||
assert_typeahead_equals("test :-P", false);
|
||||
assert_typeahead_equals("test # a", false);
|
||||
assert_typeahead_equals("test #", false);
|
||||
|
||||
var all_items = [
|
||||
{
|
||||
|
|
|
@ -289,6 +289,11 @@ exports.compose_content_begins_typeahead = function (query) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Don't autocomplete if there is a space following a '#'
|
||||
if (current_token[0] === " ") {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.completing = 'stream';
|
||||
this.token = current_token.substring(current_token.indexOf("#")+1);
|
||||
return stream_data.subscribed_subs();
|
||||
|
|
Loading…
Reference in New Issue