From e7de93cd84c50aea4fe783abf19b4e15c812affd Mon Sep 17 00:00:00 2001 From: Saptak S Date: Tue, 10 Nov 2020 20:14:23 +0530 Subject: [PATCH] Makes username input blur on pressing enter --- cli/onionshare_cli/resources/static/js/chat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/onionshare_cli/resources/static/js/chat.js b/cli/onionshare_cli/resources/static/js/chat.js index c4d76bb5..258b020b 100644 --- a/cli/onionshare_cli/resources/static/js/chat.js +++ b/cli/onionshare_cli/resources/static/js/chat.js @@ -50,7 +50,8 @@ $(function () { // Keep buttons disabled unless changed or not empty $('#username').on('keyup', function (event) { if ($('#username').val() !== '' && $('#username').val() !== current_username) { - if (event.keyCode == 13) { + if (event.keyCode == 13 || event.which == 13) { + this.blur(); current_username = updateUsername(socket) || current_username; } }