hotkeys: Don't pass input to RT when non-RT search is in focus.

This fixes the bug where a user cannot type vim keys in the
general search box / user search / stream search,
since they are captured by recent topics.

The behaviour was flaky for stream search, but can be reproduced
consistently after previous commit fixing the popovers.any_active
output.
This commit is contained in:
Aman Agrawal 2020-09-22 22:26:04 +05:30 committed by Tim Abbott
parent 2cd234f1b7
commit a45d3af3e3
1 changed files with 4 additions and 1 deletions

View File

@ -480,7 +480,10 @@ exports.process_hotkey = function (e, hotkey) {
if ( if (
["#recent_topics", "#", ""].includes(window.location.hash) && ["#recent_topics", "#", ""].includes(window.location.hash) &&
!popovers.any_active() && !popovers.any_active() &&
!overlays.is_active() !overlays.is_active() &&
!$("#searchbox_form #search_query").is(":focus") &&
!$(".user-list-filter").is(":focus") &&
!$(".stream-list-filter").is(":focus")
) { ) {
return recent_topics.change_focused_element(e, event_name); return recent_topics.change_focused_element(e, event_name);
} }