Skip to content

Commit 35e347a

Browse files
committed
feat(admin): improve login accessibility with Enter key navigation
- Add keyup event handlers for username and password fields - Implement sequential focus shift on Enter key press - Enhance user experience by allowing keyboard-only navigation
1 parent f89b3d8 commit 35e347a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

web/templates/admin/admin_login.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,14 @@
7676

7777
<script type="text/javascript">
7878
$(document).ready(function () {
79-
// 回车触发按钮事件
80-
$(document).keyup(function (event) {
79+
// 用户名输入框回车事件
80+
$("#username").keyup(function (event) {
81+
if (event.keyCode === 13) {
82+
$("#password").focus();
83+
}
84+
});
85+
// 密码输入框回车事件
86+
$("#password").keyup(function (event) {
8187
if (event.keyCode === 13) {
8288
$("#btnOk").trigger("click");
8389
}

0 commit comments

Comments
 (0)