Makes username input blur on pressing enter

This commit is contained in:
Saptak S 2020-11-10 20:14:23 +05:30
parent d1cada0f7e
commit e7de93cd84
No known key found for this signature in database
GPG Key ID: 2D9B32E54C68A3FB

View File

@ -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;
}
}