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.

click handler: Consolidate composebox-closing logic.

evykassirer429f23fc4fdd
diff --git a/web/src/click_handlers.js b/web/src/click_handlers.js
index 7ae5f291af1..e79c5f82b6d 100644
--- a/web/src/click_handlers.js
+++ b/web/src/click_handlers.js
@@ -679,14 +679,6 @@ export function initialize() {
return;
}
- // Don't let clicks in the compose area count as
- // "unfocusing" our compose -- in other words, e.g.
- // clicking "Press Enter to send" should not
- // trigger the composebox-closing code in MAIN CLICK HANDLER.
- // But do allow our formatting link.
- if (!$target.is("a")) {
- e.stopPropagation();
- }
// Still hide the popovers, however
popovers.hide_all();
}
@@ -876,6 +868,7 @@ export function initialize() {
$("#compose-textarea").trigger("focus");
return;
} else if (
+ !$(e.target).parents("#compose").length &&
!window.getSelection().toString() &&
// Clicking any input or text area should not close
// the compose box; this means using the sidebar