hotkey: Don't close compose box on topic list input ESC.

Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/Pressing.20escape.20in.20topic.20filter.20closes.20compose.20box/near/1833316
Topic list escape key action should take preference over
open composebox.
This commit is contained in:
Shubham Padia 2024-06-24 12:04:18 +00:00 committed by Tim Abbott
parent 3f8d5ea0ab
commit 991fec5b23
1 changed files with 7 additions and 7 deletions

View File

@ -334,6 +334,13 @@ export function process_escape_key(e) {
return true;
}
// When the input is focused, we blur and clear the input. A second "Esc"
// will zoom out, handled below.
if (stream_list.is_zoomed_in() && $("#filter-topic-input").is(":focus")) {
topic_list.clear_topic_search(e);
return true;
}
if (compose_state.composing()) {
// Check if the giphy popover was open using compose box.
// Hide GIPHY popover if it's open.
@ -353,13 +360,6 @@ export function process_escape_key(e) {
return true;
}
// When the input is focused, we blur and clear the input. A second "Esc"
// will zoom out, handled below.
if (stream_list.is_zoomed_in() && $("#filter-topic-input").is(":focus")) {
topic_list.clear_topic_search(e);
return true;
}
// We pressed Esc and something was focused, and the composebox
// wasn't open. In that case, we should blur the input.
$("input:focus,textarea:focus").trigger("blur");