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.

recent_topics: Extend persistent focus bug to all RT elements.

Aman Agrawalc894f50f3c02
diff --git a/static/js/recent_topics_ui.js b/static/js/recent_topics_ui.js
index b307874d05c..785e6c2ef7f 100644
--- a/static/js/recent_topics_ui.js
+++ b/static/js/recent_topics_ui.js
@@ -639,15 +639,19 @@ function filter_buttons() {
}
export function hide() {
+ // On firefox (and flaky on other browsers), focus
+ // remains on the focused element even after it is hidden. We
+ // forcefully blur it so that focus returns to the visible
+ // focused element.
+ const focused_element = $(document.activeElement);
+ if ($("#recent_topics_view").has(focused_element)) {
+ focused_element.trigger("blur");
+ }
+
$("#message_view_header_underpadding").show();
$("#message_feed_container").show();
$("#recent_topics_view").hide();
set_visible(false);
- // On firefox (and flaky on other browsers), focus
- // remains on search box even after it is hidden. We
- // forcefully blur it so that focus returns to the visible
- // focused element.
- $("#recent_topics_search").trigger("blur");
$(".header").css("padding-bottom", "10px");