Skip to content

Commit

Permalink
Implement login method start for "enter" button at password field [CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
ibardos committed May 20, 2024
1 parent bc2c126 commit df79caf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/ui/src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ const LoginForm = () => {
}
}

const handleEnterPressedToLogin = async (event) => {
if (event.key === "Enter") {
await handleSubmit(event);
}
}


return (
<Card bg={"dark"} style={{width: '300px', margin: 'auto'}}>
Expand All @@ -93,7 +99,8 @@ const LoginForm = () => {
<Form.Group className="mb-3" controlId="formTextareaPassword">
<Form.Label>password</Form.Label>
<Form.Control type="password" name="password" placeholder="password"
onChange={(event) => setPassword(event.target.value)}/>
onChange={(event) => setPassword(event.target.value)}
onKeyUp={handleEnterPressedToLogin}/>
</Form.Group>

<p style={{fontWeight: "bold", textAlign: "center", color: "red"}}>{badCredentialsAlert}</p>
Expand Down

0 comments on commit df79caf

Please sign in to comment.