Skip to content

Commit

Permalink
Add enter form submit
Browse files Browse the repository at this point in the history
  • Loading branch information
eunjuhuss committed Feb 12, 2024
1 parent fdb92c9 commit d8be023
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Login/ResponseCodeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ function CodeField({ num, value, disabled = false, autoFocus = undefined }: Code
event.preventDefault();
target.nextElementSibling.focus();
}

if ((form.getState().valid && event.key === "Enter") || event.keyCode === 13) {
form.submit();
}
}

function handlePaste(event: React.ClipboardEvent<HTMLInputElement>) {
Expand Down

0 comments on commit d8be023

Please sign in to comment.