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.

topic_list: Don't hijack Enter/arrows while filter typeahead is open.

Evy Kassirerdb229cb2cf47
diff --git a/web/src/topic_list.ts b/web/src/topic_list.ts
index 4d3b7d27511..11c4408aab2 100644
--- a/web/src/topic_list.ts
+++ b/web/src/topic_list.ts
@@ -728,6 +728,15 @@ export function setup_topic_search_typeahead(): void {
});
$input.on("keydown", (e: JQuery.KeyDownEvent) => {
+ // While the filter typeahead is open, Enter / ArrowUp /
+ // ArrowDown belong to it; don't also drive the sidebar
+ // topic-row cursor.
+ if (
+ topic_state_typeahead?.shown &&
+ (e.key === "Enter" || e.key === "ArrowDown" || e.key === "ArrowUp")
+ ) {
+ return;
+ }
switch (e.key) {
case "Enter": {
const $current_row = topic_list_cursor.get_key();