mirror of
https://github.com/glanceapp/glance.git
synced 2025-08-19 20:25:46 +02:00
Merge pull request #723 from khalt00/dev
Add allow login with enter button
This commit is contained in:
@@ -70,6 +70,18 @@ function enableLoginButtonIfCriteriaMet() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleKeydown(event) {
|
||||||
|
if (event.key === "Enter") {
|
||||||
|
const isDisabled = loginButton.disabled;
|
||||||
|
if (!isDisabled) {
|
||||||
|
handleLoginAttempt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
usernameInput.on("keydown", handleKeydown);
|
||||||
|
passwordInput.on("keydown", handleKeydown);
|
||||||
|
|
||||||
usernameInput.on("input", enableLoginButtonIfCriteriaMet);
|
usernameInput.on("input", enableLoginButtonIfCriteriaMet);
|
||||||
passwordInput.on("input", enableLoginButtonIfCriteriaMet);
|
passwordInput.on("input", enableLoginButtonIfCriteriaMet);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user