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_handlers: Don't treat dropdown menuitem clicks the same as links.

evykassirer202c04988f5e
diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js
index 6599fb5c925..9b42089f6b5 100644
--- a/static/js/click_handlers.js
+++ b/static/js/click_handlers.js
@@ -988,8 +988,13 @@ export function initialize() {
}
if (compose_state.composing()) {
+ const $closest_links = $(e.target).closest("a");
+ const nearby_link_exists = $closest_links.length > 0;
+ // Links that are actually dropdown widget don't count.
+ const inside_dropdown_widget =
+ nearby_link_exists && $closest_links[0].role === "menuitem";
if (
- $(e.target).closest("a").length > 0 ||
+ (nearby_link_exists && !inside_dropdown_widget) ||
$(e.target).closest(".copy_codeblock").length > 0
) {
// Refocus compose message text box if one clicks an external