mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
composebox_typeahead: Open typeahead immediately when @ is entered.
This change ensures that we pop up the typeahead when one has entered just `@`. This will make clear to the user about the @-mentions feature in Zulip. This also makes us consistent with expectations from other chatting apps like Slack, Discord, etc. Added few test cases and modified the present ones. Fixes: #19142.
This commit is contained in:
@@ -354,7 +354,7 @@ function filter_mention_name(current_token) {
|
||||
} else if (current_token.startsWith("*")) {
|
||||
current_token = current_token.slice(1);
|
||||
}
|
||||
if (current_token.length < 1 || current_token.lastIndexOf("*") !== -1) {
|
||||
if (current_token.lastIndexOf("*") !== -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -648,7 +648,7 @@ export function get_candidates(query) {
|
||||
current_token = current_token.slice(1);
|
||||
}
|
||||
current_token = filter_mention_name(current_token);
|
||||
if (!current_token) {
|
||||
if (!current_token && typeof current_token === "boolean") {
|
||||
this.completing = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user