mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
search: Use e.key instead of deprecated e.which.
Tested by making sure Enter works and expected in the navbar search with and without the typeahead being present.
This commit is contained in:
committed by
Tim Abbott
parent
607abc0b77
commit
a218143db7
@@ -134,8 +134,7 @@ export function initialize() {
|
||||
searchbox_form
|
||||
.on("keydown", (e) => {
|
||||
update_button_visibility();
|
||||
const code = e.which;
|
||||
if (code === 13 && search_query_box.is(":focus")) {
|
||||
if (e.key === "Enter" && search_query_box.is(":focus")) {
|
||||
// Don't submit the form so that the typeahead can instead
|
||||
// handle our Enter keypress. Any searching that needs
|
||||
// to be done will be handled in the keyup.
|
||||
@@ -147,8 +146,8 @@ export function initialize() {
|
||||
is_using_input_method = false;
|
||||
return;
|
||||
}
|
||||
const code = e.which;
|
||||
if (code === 13 && search_query_box.is(":focus")) {
|
||||
|
||||
if (e.key === "Enter" && search_query_box.is(":focus")) {
|
||||
// We just pressed Enter and the box had focus, which
|
||||
// means we didn't use the typeahead at all. In that
|
||||
// case, we should act as though we're searching by
|
||||
|
||||
Reference in New Issue
Block a user