diff --git a/static/js/activity.js b/static/js/activity.js index 04a3dd8a97..db9c3f46ef 100644 --- a/static/js/activity.js +++ b/static/js/activity.js @@ -358,6 +358,14 @@ exports.set_user_statuses = function (users, server_time) { exports.update_huddles(); }; +exports.searching = function () { + return $('.user-list-filter').expectOne().is(':focus'); +}; + +exports.clear_search = function () { + $('.user-list-filter').val(''); + update_users_for_search(); +}; $(function () { $(".user-list-filter").expectOne().on('input', update_users_for_search); diff --git a/static/js/hotkey.js b/static/js/hotkey.js index 9e7d166ecd..7b18f51dae 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -192,6 +192,9 @@ function process_hotkey(e) { } else if ($(".message_edit_content").filter(":focus").length > 0) { row = $(".message_edit_content").filter(":focus").closest(".message_row"); message_edit.end(row); + } else if (activity.searching()) { + activity.clear_search(); + return true; } else if (compose.composing()) { // If the user hit the escape key, cancel the current compose compose.cancel();