Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_edit: Use e.key instead of deprecated e.which.

Priyank Patelf2aae91cc11c
diff --git a/frontend_tests/node_tests/stream_edit.js b/frontend_tests/node_tests/stream_edit.js
index a720f78a34b..648fbf1cd58 100644
--- a/frontend_tests/node_tests/stream_edit.js
+++ b/frontend_tests/node_tests/stream_edit.js
@@ -301,7 +301,7 @@ test_ui("subscriber_pills", (override) => {
"keyup",
".subscriber_list_add form",
);
- event.which = 13;
+ event.key = "Enter";
// Only Denmark stream pill is created and a
// request is sent to add all it's subscribers.
diff --git a/static/js/stream_edit.js b/static/js/stream_edit.js
index e326c809bec..52cedf897e1 100644
--- a/static/js/stream_edit.js
+++ b/static/js/stream_edit.js
@@ -808,7 +808,7 @@ export function initialize() {
);
$("#subscriptions_table").on("keyup", ".subscriber_list_add form", (e) => {
- if (e.which === 13) {
+ if (e.key === "Enter") {
e.preventDefault();
submit_add_subscriber_form(e);
}