mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
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.
This commit is contained in:
@@ -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")
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user