From 5fa027a577b60b4ecb33578765780ebea1f604ff Mon Sep 17 00:00:00 2001 From: Sayam Samal Date: Fri, 12 Sep 2025 14:31:06 +0530 Subject: [PATCH] views_util: Use ".input-element" selector to check for focused inputs. Previously, we were using the ".home-page-input" selector to check for any focused input elements in the home page view of the Zulip Web UI. Since all of these inputs, other than the navbar search input have now been converted to filter inputs, we can simplify the logic to check for any focused input elements with the ".input-element" selector. The navbar search input has a different selector, "#search_query", which is already accounted for in the views_util.is_in_focus() method. Now, ".input-element" class will potentially be used for several other inputs in the UI other than the home page view, but the is_in_focus() method already accounts for other focused elements like compose, overlays, popovers, etc, and thus the logic remains unaffected. Fixes part of #35135. --- web/src/views_util.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/views_util.ts b/web/src/views_util.ts index 7c36b1bb27..7ab52f10e6 100644 --- a/web/src/views_util.ts +++ b/web/src/views_util.ts @@ -156,9 +156,8 @@ export function is_in_focus(): boolean { !sidebar_ui.any_sidebar_expanded_as_overlay() && !overlays.any_active() && !modals.any_active_or_animating() && - !$(".home-page-input").is(":focus") && + !$(".input-element").is(":focus") && !$("#search_query").is(":focus") && - !$("#topic_filter_query").is(":focus") && !$(".navbar-item").is(":focus") ); }