mirror of
https://github.com/glanceapp/glance.git
synced 2025-08-19 12:24:45 +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);
|
||||
passwordInput.on("input", enableLoginButtonIfCriteriaMet);
|
||||
|
||||
|
Reference in New Issue
Block a user