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: Avoid jQuery sizzle extension :visible.

Anders Kaseorg09bc4d90d3d1
diff --git a/web/src/search.ts b/web/src/search.ts
index f60f9907542..338b37422cf 100644
--- a/web/src/search.ts
+++ b/web/src/search.ts
@@ -281,11 +281,7 @@ export function initialize(opts: {on_narrow_search: OnNarrowSearch}): void {
// Record this on keydown before the typeahead code closes the
// typeahead, so we can use this information on keyup.
- if (keydown_util.is_enter_event(e) && $("#searchbox_form .typeahead").is(":visible")) {
- typeahead_was_open_on_enter = true;
- } else {
- typeahead_was_open_on_enter = false;
- }
+ typeahead_was_open_on_enter = keydown_util.is_enter_event(e) && search_typeahead.shown;
})
.on("keyup", (e: JQuery.KeyUpEvent): void => {
if (is_using_input_method) {