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 unused second argument to caret().

evykassirer9cb9733f71f9
diff --git a/web/src/composebox_typeahead.js b/web/src/composebox_typeahead.js
index 9da4cbfd823..6f41462e080 100644
--- a/web/src/composebox_typeahead.js
+++ b/web/src/composebox_typeahead.js
@@ -1015,7 +1015,7 @@ export function content_typeahead_selected(item, query, input_element, event) {
rest = rest.slice(1);
}
$textbox.val(beginning + rest);
- $textbox.caret(beginning.length, beginning.length);
+ $textbox.caret(beginning.length);
compose_ui.autosize_textarea($textbox);
};
flatpickr.show_flatpickr(input_element.$element[0], on_timestamp_selection, timestamp);
@@ -1031,7 +1031,7 @@ export function content_typeahead_selected(item, query, input_element, event) {
if (highlight.start && highlight.end) {
$textbox.range(highlight.start, highlight.end);
} else {
- $textbox.caret(beginning.length, beginning.length);
+ $textbox.caret(beginning.length);
}
// Also, trigger autosize to check if compose box needs to be resized.
compose_ui.autosize_textarea($textbox);
diff --git a/web/tests/composebox_typeahead.test.js b/web/tests/composebox_typeahead.test.js
index 0a57d4f662c..3bdae9fd8a1 100644
--- a/web/tests/composebox_typeahead.test.js
+++ b/web/tests/composebox_typeahead.test.js
@@ -483,9 +483,6 @@ test("content_typeahead_selected", ({override}) => {
caret_called1 = true;
return query.length;
}
- const [arg1, arg2] = args;
- // .caret() used in setTimeout
- assert.equal(arg1, arg2);
caret_called2 = true;
return this;
};