diff --git a/web/src/composebox_typeahead.js b/web/src/composebox_typeahead.js index 9e53718c2a..fa9096f0bd 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 5c18d45f7f..6cd658c6fb 100644 --- a/web/src/typeahead_helper.ts +++ b/web/src/typeahead_helper.ts @@ -36,14 +36,6 @@ export type CombinedPillItem = | InputPillItem | InputPillItem; -// 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 8da26cd02c..f465d40497 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("othello@zulip.com, "); - $("#private_message_recipient").trigger("blur"); - assert.equal($("#private_message_recipient").val(), "othello@zulip.com"); - // the UI of selecting a stream is tested in puppeteer tests. compose_state.set_stream_id(sweden_stream.stream_id);