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.

poll_widget: Use e.key instead of deprecated e.keyCode.

Priyank Patel121e21d3b946
diff --git a/static/js/poll_widget.js b/static/js/poll_widget.js
index b7005c8b339..d48180e4a76 100644
--- a/static/js/poll_widget.js
+++ b/static/js/poll_widget.js
@@ -125,12 +125,12 @@ export function activate({
elem.find("input.poll-question").on("keydown", (e) => {
e.stopPropagation();
- if (e.keyCode === 13) {
+ if (e.key === "Enter") {
submit_question();
return;
}
- if (e.keyCode === 27) {
+ if (e.key === "Escape") {
abort_edit();
return;
}
@@ -159,12 +159,12 @@ export function activate({
elem.find("input.poll-option").on("keydown", (e) => {
e.stopPropagation();
- if (e.keyCode === 13) {
+ if (e.key === "Enter") {
submit_option();
return;
}
- if (e.keyCode === 27) {
+ if (e.key === "Escape") {
$("input.poll-option").val("");
return;
}