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.

compose_send_menu_popover: Focus textarea after selecting enter sends.

Aman Agrawalecadb00ce4b8
diff --git a/web/src/compose_send_menu_popover.js b/web/src/compose_send_menu_popover.js
index d0d72b39071..2fa4c3d1798 100644
--- a/web/src/compose_send_menu_popover.js
+++ b/web/src/compose_send_menu_popover.js
@@ -223,10 +223,6 @@ export function initialize() {
selected_behaviour = selected_behaviour === "true"; // Convert to bool
user_settings.enter_sends = selected_behaviour;
- // Refocus in the content box so you can continue typing or
- // press Enter to send.
- $("textarea#compose-textarea").trigger("focus");
-
channel.patch({
url: "/json/settings",
data: {enter_sends: selected_behaviour},
@@ -234,6 +230,9 @@ export function initialize() {
e.stopPropagation();
setTimeout(() => {
popover_menus.hide_current_popover_if_visible(instance);
+ // Refocus in the content box so you can continue typing or
+ // press Enter to send.
+ $("textarea#compose-textarea").trigger("focus");
}, ENTER_SENDS_SELECTION_DELAY);
});
// Handle Send later clicks