recent_topics: Extend persistent focus bug to all RT elements.

The bug fix for RT search, also needs to be applied to other
elements.

Fixes #19458.
This commit is contained in:
Aman Agrawal 2021-12-03 14:40:13 +00:00 committed by Tim Abbott
parent 2eaf869949
commit c894f50f3c
1 changed files with 9 additions and 5 deletions

View File

@ -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");