From a210ee2b7d849fbf5355b3ab5acc2fea66236644 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Mon, 15 Feb 2021 14:33:37 +0000 Subject: [PATCH] recent_topics: Don't revive focus when user is trying to type. --- static/js/recent_topics.js | 6 ++++++ templates/zerver/app/left_sidebar.html | 2 +- templates/zerver/app/navbar.html | 2 +- templates/zerver/app/right_sidebar.html | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/static/js/recent_topics.js b/static/js/recent_topics.js index 848bbefd1a..c87d0d13ae 100644 --- a/static/js/recent_topics.js +++ b/static/js/recent_topics.js @@ -78,6 +78,12 @@ function revive_current_focus() { // After re-render, the current_focus_elem is no longer linked // to the focused element, this function attempts to revive the // link and focus to the element prior to the rerender. + + // Don't change focus if user is trying to type anywhere. + if ($(".home-page-input").is(":focus")) { + return false; + } + if (!current_focus_elem) { set_default_focus(); return false; diff --git a/templates/zerver/app/left_sidebar.html b/templates/zerver/app/left_sidebar.html index f535ce50cb..ef55ff9ef0 100644 --- a/templates/zerver/app/left_sidebar.html +++ b/templates/zerver/app/left_sidebar.html @@ -71,7 +71,7 @@
- + diff --git a/templates/zerver/app/navbar.html b/templates/zerver/app/navbar.html index 9a64fed612..74a1bd58d4 100644 --- a/templates/zerver/app/navbar.html +++ b/templates/zerver/app/navbar.html @@ -31,7 +31,7 @@
- +