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.

search: Don't use e.target for the query click handler.

evykassirer20e4778163ed
diff --git a/web/src/search.ts b/web/src/search.ts
index be47adbb1ae..6c9f9681b60 100644
--- a/web/src/search.ts
+++ b/web/src/search.ts
@@ -172,8 +172,8 @@ export function initialize({on_narrow_search}: {on_narrow_search: OnNarrowSearch
// when an option is selected and we're closing search).
// Instead we explicitly initiate search on click and on specific keyboard
// shortcuts.
- $search_query_box.on("click", (e: JQuery.ClickEvent): void => {
- if ($(e.target).parents(".navbar-search.expanded").length === 0) {
+ $search_query_box.on("click", (): void => {
+ if ($("#searchbox .navbar-search.expanded").length === 0) {
initiate_search();
}
});