mirror of https://github.com/zulip/zulip.git
parent
35577a1f66
commit
ba9668470c
|
@ -983,10 +983,12 @@ run_test('begins_typeahead', () => {
|
|||
assert_typeahead_equals(" :", false);
|
||||
assert_typeahead_equals(":)", false);
|
||||
assert_typeahead_equals(":4", false);
|
||||
assert_typeahead_equals(": la", false);
|
||||
assert_typeahead_equals("test :-P", false);
|
||||
assert_typeahead_equals("hi emoji :", false);
|
||||
assert_typeahead_equals("hi emoj:i", false);
|
||||
assert_typeahead_equals("hi emoji :D", false);
|
||||
assert_typeahead_equals("hi emoji : t", false);
|
||||
assert_typeahead_equals("hi emoji :t", emoji_list);
|
||||
assert_typeahead_equals("hi emoji :ta", emoji_list);
|
||||
assert_typeahead_equals("hi emoji :da", emoji_list);
|
||||
|
|
|
@ -351,6 +351,10 @@ exports.compose_content_begins_typeahead = function (query) {
|
|||
if (/^:-.?$/.test(current_token) || /^:[^a-z+]?$/.test(current_token)) {
|
||||
return false;
|
||||
}
|
||||
// Don't autocomplete if there is a space following a ':'
|
||||
if (current_token[1] === " ") {
|
||||
return false;
|
||||
}
|
||||
this.completing = 'emoji';
|
||||
this.token = current_token.substring(1);
|
||||
return emoji.emojis;
|
||||
|
|
Loading…
Reference in New Issue