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: Fix search box not focused in expanded state.

Aman Agrawald4c70319eb08
diff --git a/static/js/topic_list.js b/static/js/topic_list.js
index 1136d95ec63..a4dbc5c32af 100644
--- a/static/js/topic_list.js
+++ b/static/js/topic_list.js
@@ -214,6 +214,9 @@ export class TopicListWidget {
const input = this.parent_elem.find("#filter-topic-input");
if (input.length) {
this.update_topic_search_text(input.val());
+ // Only set focus on search input if it was focused before the update.
+ this.topic_search_focused_before_build =
+ document.activeElement.id === "filter-topic-input";
} else {
// Clear the topic search input when zooming out.
this.update_topic_search_text("");
@@ -233,7 +236,6 @@ export class TopicListWidget {
const find = () => this.parent_elem.find(".topic-list");
- this.topic_search_focused_before_build = document.activeElement.id === "filter-topic-input";
vdom.update(replace_content, find, new_dom, this.prior_dom);
this.prior_dom = new_dom;