OSDN Git Service

[更新]:エンターキーで勝手に送信されてしまう問題の修正
authornaoko1010hh <naoko561010@gmail.com>
Sun, 1 Mar 2020 12:59:07 +0000 (21:59 +0900)
committernaoko1010hh <naoko561010@gmail.com>
Sun, 1 Mar 2020 12:59:07 +0000 (21:59 +0900)
js/theme.js

index 5f2a255..42605f4 100644 (file)
@@ -51,9 +51,11 @@ $(greeter).on("ready", function(e) {
                /* Attempt authentication, 'grant' event will be emitted on sucecss
                and 'deny' will be emitted on failure */
                if (e.keyCode == 13) {
-                       let username = $user.children("option:selected").val();
-                       let pass = $password.val();
-                       greeter.auth(username, pass);
+                       if(!$(this).val() == ""){
+                               let username = $user.children("option:selected").val();
+                               let pass = $password.val();
+                               greeter.auth(username, pass);
+                       }
                }
 
        });