Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
web: Replace the deprecated `keypress` event with `keydown`.
Prakhar Pratyushc98bc0bd01dc
diff --git a/web/src/portico/integrations.ts b/web/src/portico/integrations.tsindex a9cb3868d72..c0ce15876ea 100644--- a/web/src/portico/integrations.ts+++ b/web/src/portico/integrations.ts@@ -274,7 +274,7 @@ function toggle_categories_dropdown(): void {}function integration_events(): void {- $<HTMLInputElement>('#integration-search input[type="text"]').on("keypress", function (e) {+ $<HTMLInputElement>('#integration-search input[type="text"]').on("keydown", function (e) {if (e.key === "Enter" && this.value !== "") {$(".integration-lozenges .integration-lozenge:not([hidden])")[0]?.closest("a")?.click();}diff --git a/web/src/portico/signup.ts b/web/src/portico/signup.tsindex ce4f26b5276..0319291baa2 100644--- a/web/src/portico/signup.ts+++ b/web/src/portico/signup.ts@@ -319,8 +319,8 @@ $(() => {$("#new-user-email-address-visibility .current-selected-option").text(selected_option_text);});- $("#registration").on("click keypress", ".edit-realm-details", (e) => {- if (e.type === "keypress" && e.key !== "Enter") {+ $("#registration").on("click keydown", ".edit-realm-details", (e) => {+ if (e.type === "keydown" && e.key !== "Enter") {return;}diff --git a/web/src/stream_edit.ts b/web/src/stream_edit.tsindex 73369f18ed2..09762fed33e 100644--- a/web/src/stream_edit.ts+++ b/web/src/stream_edit.ts@@ -577,7 +577,7 @@ export function initialize(): void {},);- $("#channels_overlay_container").on("keypress", "#change_stream_description", (e) => {+ $("#channels_overlay_container").on("keydown", "#change_stream_description", (e) => {// Stream descriptions cannot be multiline, so disable enter key// to prevent new lineif (keydown_util.is_enter_event(e)) {diff --git a/web/src/stream_settings_ui.ts b/web/src/stream_settings_ui.tsindex d8d5bde6f84..95be4f123e8 100644--- a/web/src/stream_settings_ui.ts+++ b/web/src/stream_settings_ui.ts@@ -906,7 +906,7 @@ function setup_page(callback: () => void): void {// is only useful if the user has permission to create// streams, either explicitly via user_can_create_streams, or// implicitly because realm.realm_is_zephyr_mirror_realm.- $("#stream_filter input[type='text']").on("keypress", (e) => {+ $("#stream_filter input[type='text']").on("keydown", (e) => {if (!keydown_util.is_enter_event(e)) {return;}diff --git a/web/src/user_status_ui.ts b/web/src/user_status_ui.tsindex 4957cdd1dfc..477b7e06c12 100644--- a/web/src/user_status_ui.ts+++ b/web/src/user_status_ui.ts@@ -164,7 +164,7 @@ function user_status_post_render(): void {update_button();});- input_field().on("keypress", (event) => {+ input_field().on("keydown", (event) => {if (keydown_util.is_enter_event(event)) {event.preventDefault();