Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

composebox_typeahead: Remove DM blur handler.

evykassirer19a4810d5353
diff --git a/web/src/composebox_typeahead.js b/web/src/composebox_typeahead.js
index 9e53718c2a9..fa9096f0bda 100644
--- a/web/src/composebox_typeahead.js
+++ b/web/src/composebox_typeahead.js
@@ -1262,10 +1262,4 @@ export function initialize({on_enter_send}) {
});
initialize_compose_typeahead("textarea#compose-textarea");
-
- $("#private_message_recipient").on("blur", function () {
- const val = $(this).val();
- const recipients = typeahead_helper.get_cleaned_pm_recipients(val);
- $(this).val(recipients.join(", "));
- });
}
diff --git a/web/src/typeahead_helper.ts b/web/src/typeahead_helper.ts
index 5c18d45f7f6..6cd658c6fbb 100644
--- a/web/src/typeahead_helper.ts
+++ b/web/src/typeahead_helper.ts
@@ -36,14 +36,6 @@ export type CombinedPillItem =
| InputPillItem<UserGroupPill>
| InputPillItem<StreamPill>;
-// Returns an array of direct message recipients, removing empty elements.
-// For example, "a,,b, " => ["a", "b"]
-export function get_cleaned_pm_recipients(query_string: string): string[] {
- let recipients = util.extract_pm_recipients(query_string);
- recipients = recipients.filter((elem) => elem.match(/\S/));
- return recipients;
-}
-
export function build_highlight_regex(query: string): RegExp {
const regex = new RegExp("(" + _.escapeRegExp(query) + ")", "ig");
return regex;
diff --git a/web/tests/composebox_typeahead.test.js b/web/tests/composebox_typeahead.test.js
index 8da26cd02c6..f465d40497f 100644
--- a/web/tests/composebox_typeahead.test.js
+++ b/web/tests/composebox_typeahead.test.js
@@ -1199,10 +1199,6 @@ test("initialize", ({override, override_rewire, mock_template}) => {
on_enter_send: finish,
});
- $("#private_message_recipient").val("[email protected], ");
- $("#private_message_recipient").trigger("blur");
- assert.equal($("#private_message_recipient").val(), "[email protected]");
-
// the UI of selecting a stream is tested in puppeteer tests.
compose_state.set_stream_id(sweden_stream.stream_id);