From 63cf47b63a10e1a4efda613df6d724ec320dd35f Mon Sep 17 00:00:00 2001 From: Priyank Patel Date: Sat, 29 May 2021 20:16:37 +0000 Subject: [PATCH] stream_create: Use e.key instead of deprecated e.keyCode. Tested by making sure pressing Enter in the stream creation description did not create a new line. --- static/js/stream_create.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/stream_create.js b/static/js/stream_create.js index dca92e666a..58b9b4f8f8 100644 --- a/static/js/stream_create.js +++ b/static/js/stream_create.js @@ -483,7 +483,7 @@ export function set_up_handlers() { // Do not allow the user to enter newline characters while typing out the // stream's description during it's creation. container.on("keydown", "#create_stream_description", (e) => { - if ((e.keyCode || e.which) === 13) { + if (e.key === "Enter") { e.preventDefault(); } });